rfd
rfd copied to clipboard
How to actually use AsyncFileDialog in WASM?
I got a function, not in the main loop, that needs file from a user.
I used AsyncFilePicker with wasm_bindgen_futures::spawn_local. However, this leads to the function continuing to run past that point and straight into a data race, where the file picker always loses since it is scheduled at the next tick, and the outer function wants to return immediately. I tried to approach this problem with channels, but I can't block the thread to wait on one.
using either crossbeam-channels or flume you can wait for the channel in a non blocking way with try_iter