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.78k stars 147 forks source link

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

Closed jbms closed 4 months ago

jbms commented 6 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 4 months ago

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

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