Releases: charkour/zundo
v2.0.0-experimental.0
Support zustand v4 with an updated API. This is an experimental release that will be similar to v2 of zundo.
BREAKING CHANGES
The methods undo
, redo
, clear
, setIsUndoHistoryEnabled
, and getState
are not accessed from useStore.temporal
instead of useStore()
.
const { undo, redo, clear, setIsUndoHistoryEnabled, getState } = useStore.temporal;
What's Changed
- reworked types, methods now on useStore by @funwithtriangles in #44
Full Changelog: v1.6.0...v2.0.0-experimental.0
v1.6.0
v2.0.0-beta.0
What's Changed
- Updated undo and redo to accept a number of steps by @ivoilic in #32
- This includes an awesome mascot image made by @ivoilic 🎉
Breaking Changes
- Changes to undo/redo callbacks By default the event is passed which throws a type error since the functions are now expecting a number as the first parameter.
- <button onClick={undo} />
+ <button onClick={() => undo?.() />
clear
now becomescleaUndoHistory
- const { clear } = useUndoStore();
+ const { clearUndoHistory } = useUndoStore();
To use the beta: npm i zundo@2.0.0-beta.0
Full Changelog: v1.5.9...v2.0.0-beta.0
v1.5.9
What's Changed
Usage
// Only field1 and field2 will be tracked
const useStoreA = create<StoreState>(
undoMiddleware(
set => ({ ... }),
{ include: ['field1', 'field2'] }
)
);
// Everything besides field1 and field2 will be tracked
const useStoreB = create<StoreState>(
undoMiddleware(
set => ({ ... }),
{ exclude: ['field1', 'field2'] }
)
);
New Contributors
Full Changelog: v1.5.8...v1.5.9
v1.5.8
v1.5.7
Fixed bug in v1.5.2 where users were unable to run npm install zundo@1.5.2
. Tried to publish different fixes until finding the correct solution. v1.5.2 through v1.5.6 were published and removed from the npm package registry because they were broken. Sorry for the inconvenience.
What's Changed
Full Changelog: v1.5.2...v1.5.7
v1.5.2
v1.5.1
What's Changed
Adds a cool-off period option between adding states to the undo stores.
- Cool-off period by @funwithtriangles in #23
- Fix/cool off tests by @funwithtriangles in #25
Note: Was having trouble publishing to npm, so version v1.5.0 is the same as v1.5.1
Full Changelog: v1.4.1...v1.5.1
v1.4.1
v1.4.0
Add historyDepthLimit
to zundo
store options.
const useStore = create<StoreState>(
undoMiddleware(
set => ({ ... }),
{ historyDepthLimit: 100 }
)
);