Macro artemis_codegen_proc_macro::wasm_client[][src]

wasm_client!() { /* proc-macro */ }

Generate a WASM client wrapper that gets exported in your WASM binary This is required because WASM doesn’t support generics and the regular Client uses a lot of them. It will hard-code your exchanges, as well as other options you may pass to the macro.

Additional options can be passed from JavaScript, only exchanges and the query enum are required. The query enum is generated by artemis-build and is located in the root of your query module.

Make sure this is located in a WASM-only module or annotate it with #[cfg(target_arch = "wasm32")]


use artemis::wasm_client;
use artemis::default_exchanges::{DedupExchange, CacheExchange, FetchExchange};
use artemis_test::queries::wasm::Queries;

wasm_client! {
    exchanges: [
    url: "my_url",
    queries: Queries