-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
so that was.. a bit of work! first i did the copying which went really well and took no time. then tried handling pasting.. and oh boy! first of all "Promise"? really? the works of evil witchcraft! i tried handling it by giving the whole thing as a callback, but world can't escape the system. then tried converting it to a future using wasm_bindgen_futures and that was its own deal. i still don't feel comortable with async stuff. i tried using the bevy compute task to spawn the future and get its value inside the system, but JsFuture are not Send and i couldn't figure out how to use the spawn_local with the compute. tried wasm_bindgen_futures' spawn_local() but that only takes futures with result () so i didn't know how to get the string out of there. lots of closures where the compiler yells because something moved... aaaa i'm so happy this is done! and after i did it like this it still didn't work because the callback was being dropped.. i couldn't stick the callback in a bevy resource (because not Send) so i just said fuck it and mem::forget it. i doubt anyone can abuse this to cause any serious leak (famous last words?)
- Loading branch information
Showing
5 changed files
with
66 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters