Skip to content
Discussion options

You must be logged in to vote

is this the right emit method from Rust?

yes though it depends a bit on your listen call which you're not showing here.

generally speaking the window.__TAURI__ api is supported the same as npm. If you see docs only showing imports you can always convert them, for example:

import { someFunction } from "@tauri-apps/api/someModule"; // somePlugin is `api` for 
import { somePluginFunction } from "@tauri-apps/plugin-somePlugin/someModule";
// ^ equal to:
const { someFunction } = window.__TAURI__.someModule;
const { somePluginFunction } = window.__TAURI__.somePlugin.someModule;

My other project I can invoke and .then ((response)... but I just want to listen. My other Tauri project uses const…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by DustyArmstrong
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants