MCPcopy Create free account
hub / github.com/Moosync/Moosync / load_selective

Function load_selective

src/utils/prefs.rs:29–41  ·  view source on GitHub ↗
(key: String, setter: impl Set<Value = T> + 'static)

Source from the content-addressed store, hash-verified

27
28#[tracing::instrument(level = "debug", skip(key, setter))]
29pub fn load_selective<T>(key: String, setter: impl Set<Value = T> + 'static)
30where
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))]
44pub fn save_selective_number(key: String, value: String) {

Callers 8

MainAppFunction · 0.85
AppFunction · 0.85
PathsPrefFunction · 0.85
InputPrefFunction · 0.85
CheckboxPrefFunction · 0.85
ThemesPrefFunction · 0.85
DropdownPrefFunction · 0.85
initializeMethod · 0.85

Calls 2

cloneMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected