Crates.io | svelte-store |
lib.rs | svelte-store |
version | 0.1.3 |
source | src |
created_at | 2022-08-01 16:02:51.093498 |
updated_at | 2022-08-28 00:06:43.279121 |
description | Ergonomic Rust wrapper for using Svelte stores through WASM. |
homepage | https://github.com/jquesada2016/svelte-store-wasm |
repository | https://github.com/jquesada2016/svelte-store-wasm |
max_upload_size | |
id | 636914 |
size | 13,306 |
This crate is intended to make working with svelte stores easy and ergonomic. Specifically, the goal is to allow easier use of Rust as the backend of a svelte app where the UI can directly react to changes that happen with the Rust-WASM world.
This crate exposes one struct, mainly [Readable
], which
allows seemless management of readable Svelte stores in JS.
Despite it's name, [Readable
] can be written to from Rust,
but only yields a Readable
store to JS, making sure that
mutation can only happen within Rust's safety guarantees.
These stores can additionally be annotated with Typescript types
to provide better safety from the JS side. To see how, check out
the [Readable::get_store
] example. (Note: [Readable::get_store
]
fn and example is only available on wasm32
targets)
License: MIT