Releases: charkour/zundo
v1.3.0
Add setIsUndoHistoryEnabled
to the returned store from zundo create
. This allows users to programmatically ignore or save states in the global store. const { setIsUndoHistoryEnabled } = useStore();
Thanks to @funwithtriangles! π
v1.2.2
v1.2.1
v1.2.0
Breaking Change: New updates to the zundo
middleware options. Options now is the structure { omited: string[], allowUnchanged: boolean }
. It is used within this context. Thanks @funwithtriangles! π
const useStore = create(
undoMiddleware(
set => ({ ... }),
{ omit: ['ignored'], allowUnchanged: true }
)
);
This is breaking because in the past, unchanged states were tracked in history. Please let me know if this makes you upset. Sorry in advance. I figured it was okay since not many people use this package.
- fix linting errors ca845ed
- lint and autoformat 962631e
- update lockfile cdbfefc
- Merge pull request #16 from funwithtriangles/feature/ignore-no-change efa51f4
- Moved helper function injection to top of function b634403
- Injecting helper functions at very end of set 729fb15
- Use lodash.isequal instead of lodash 71b0a31
- Added "allow unchanged" story 90a2f95
- Only storing changes if states aren't equal 8a86ed8
- Updated bears story with "do nothing" 2d300d5
v1.1.2
v1.1.1
Can pass options through the default create
function. Switch to pnpm
from npm
for dep management.
- add np config sindresorhus/np#251 5b8e952
- bump deps a17ae84
- switch to pnpm c41c4cd
- pass options parameter through create 1f97106
v1.1.0
Add's optional second parameter to undoMiddleware
, an options object. Currently only takes { omit: ['string']} which is used to omit fields from being tracked in state.
zustand dep bumped to 3.5.6
v1.0.0
Version 1.0.0 release! This has some Breaking Changes and also new features!
undo
has been renamed toundoMiddleware
- import { undo } from 'zundo';
+ import { undoMiddleware, UndoState } from 'zundo';useUndo()
is no longer a hook, the object returned fromuseUndo()
is now part of the store you create
use like this
const {
bears,
increasePopulation,
removeAllBears,
decreasePopulation,
undo,
clear,
redo,
getState,
} = store;
New features include:
-
a simplified API
-
the ability to have multiple undoable stores in a single app
-
a create function from zundo to create your undoable stores
-
Update README.md 113f31e
-
Merge pull request #7 from charkour/multiple-undo-stores eaca784
-
update documentation 3861aa5
-
multiple undo stores c65a8ca
-
separate files 15e78f3
-
update zustand dependency 4f6dc47
-
Update README.md 5f772fe
-
inject useUndo into the undo middleware 524478a
-
create undoStore factory 147c08d