Closed betta-cyber closed 1 year ago
my code like this:
let (store, dispatch) = use_store::<Store>(); let user = store.auth_user.clone(); console_log!("{:#?}", user);
#[derive(Debug, Serialize, Deserialize, Default, Clone, PartialEq, Store)] #[store(storage = "local", storage_tab_sync)] pub struct Store { pub auth_user: Option<User>, pub page_loading: bool, pub alert_input: AlertInput, } pub fn set_auth_user(user: Option<User>, dispatch: Dispatch<Store>) { dispatch.reduce_mut(move |store| { store.auth_user = user; }) }
When i use Chrome, console log show:
When i use safari, console log show always None :
Maybe storage_tab_sync ? or other problem ?
storage_tab_sync
I'm sorry, it's my code logic problem.
my code like this:
When i use Chrome, console log show:
When i use safari, console log show always None :
Maybe
storage_tab_sync
? or other problem ?