rustwasm / gloo

A modular toolkit for building fast, reliable Web applications and libraries with Rust and WASM
https://gloo-rs.web.app
Apache License 2.0
1.76k stars 146 forks source link

Use direct global binding for `fetch` in place of web_sys fetch bindings #474

Closed jbms closed 2 months ago

jbms commented 4 months ago

This avoids the need to detect whether the module is running in the main browser thread or in a WebWorker.

This matches how setInterval and related functions are handled by the gloo-timers crate.

See https://github.com/rustwasm/wasm-bindgen/discussions/3863

littlebenlittle commented 2 months ago

Confirmed with #486 that this is a fix for #484!

Is there any case where a context-specific fetch would be necessary?