(key: String, setter: impl Set<Value = T> + 'static)
| 27 | |
| 28 | #[tracing::instrument(level = "debug", skip(key, setter))] |
| 29 | pub fn load_selective<T>(key: String, setter: impl Set<Value = T> + 'static) |
| 30 | where |
| 31 | T: DeserializeOwned, |
| 32 | { |
| 33 | spawn_local(async move { |
| 34 | let res = super::invoke::load_selective(key.clone()).await; |
| 35 | if let Err(e) = res { |
| 36 | tracing::error!("Failed to load preference: {}: {:?}", key, e); |
| 37 | return; |
| 38 | } |
| 39 | setter.set(serde_wasm_bindgen::from_value(res.unwrap()).unwrap()); |
| 40 | }); |
| 41 | } |
| 42 | |
| 43 | #[tracing::instrument(level = "debug", skip(key, value))] |
| 44 | pub fn save_selective_number(key: String, value: String) { |
no test coverage detected