Properties
Private
_cursor
_cursor: number = -1
Private
_initialState
_initialState: State
Private
_snapshot
_snapshot: State
Private
_state
_state: State
Private
_store
_store: StoreApi<State & DerivedState>
Optional
onCommand
onCommand?: ((command, id?) => void)
Type declaration
- (command, id?): void
Parameters
command: Command<State>
Optional
id: string
Returns void
Optional
onPatch
onPatch?: ((state) => void)
Type declaration
- (state): void
Returns void
Optional
onRedo
onRedo?: ((state) => void)
Type declaration
- (state): void
Returns void
Optional
onReplaceHistory
onReplaceHistory?: ((state) => void)
Type declaration
- (state): void
Returns void
Optional
onReset
onReset?: ((state) => void)
Type declaration
- (state): void
Returns void
Optional
onResetHistory
onResetHistory?: ((state) => void)
Type declaration
- (state): void
Returns void
Optional
onUndo
onUndo?: ((state) => void)
Type declaration
- (state): void
Returns void
在正式更新状态之前执行最后的修改。
默认的实现是直接返回了
merge(next, patchState)
的结果,也就是没有做任何修 改。在扩展Zeit
类时重写这个方法来实现自定义的修改或者其他副作用(side effects),比如说日志,调试等等。请注意,此方法内执行的修改是无法撤销的。