chore: bump version to 0.3.11 — 状态栏扩展点架构
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { create } from 'zustand'
|
||||
|
||||
/**
|
||||
* 轻量 auto-save 状态 store
|
||||
*
|
||||
* 解耦 useAutoSave hook 与状态栏组件——状态栏的 auto-save 项通过
|
||||
* 本 store 读取状态,无需在 render 函数中重复调用 useAutoSave()。
|
||||
* useAutoSave hook 负责写入本 store。
|
||||
*/
|
||||
|
||||
interface AutoSaveState {
|
||||
isAutoSaving: boolean
|
||||
autoSaveEnabled: boolean
|
||||
}
|
||||
|
||||
interface AutoSaveStore extends AutoSaveState {
|
||||
setState: (partial: Partial<AutoSaveState>) => void
|
||||
}
|
||||
|
||||
export const useAutoSaveStore = create<AutoSaveStore>((set) => ({
|
||||
isAutoSaving: false,
|
||||
autoSaveEnabled: true,
|
||||
setState: (partial) => set(partial)
|
||||
}))
|
||||
Reference in New Issue
Block a user