I wanted to build a music player with tauri, mainly for my convenience, I ended up deciding to handle the music playback on the rust backend side, I have never coded anything in rust and I'm learning on the go, in order to pass data to the frontend (e.g. playback info, metadata, the list of songs indexed, etc.) should I build a proper API/websocket system or is there a better standard?
#How should I handle passing large amounts of data between the backend and frontend?
3 messages · Page 1 of 1 (latest)
I don't know how effecient the other mentioned techniques are, but the typical way to pass data from the back to the front end would be with emit() (https://docs.rs/tauri/2.0.0-beta.22/tauri/trait.Manager.html#method.emit) in Rust, then listen() (https://v2.tauri.app/reference/javascript/api/namespaceevent/#listen) in JS / TS. And it works the other way around too!
I'm guessing it has the same behaiviour as a websocket, correct? regardless it's apreciated, thanks!