Skip to main content

use_draft_protection

Function use_draft_protection 

Source
pub(super) fn use_draft_protection<T: Clone + PartialEq + Serialize + DeserializeOwned + Send + Sync + 'static>(
    slot: String,
    current: RwSignal<T>,
    dirty: impl Fn() -> bool + Copy + Send + Sync + 'static,
) -> (RwSignal<Option<T>>, RwSignal<bool>)
Expand description

返回(待恢复的本地副本,副本写入失败标记)。

恢复副本在水合之后的首个 Effect 里读取:服务端与水合首帧一律没有副本, 两端 DOM 一致;beforeunload 与导航协调器的离开保护只在浏览器注册。