@coaction/history
v3.0.0
Published
A undo/redo middleware for Coaction
Downloads
328
Maintainers
Readme
@coaction/history
A undo/redo middleware for Coaction.
Installation
Install it with pnpm:
pnpm add coaction @coaction/historyUsage
import { create } from 'coaction';
import { history } from '@coaction/history';
const store = create(
(set) => ({
count: 0,
increment() {
set((draft) => {
draft.count += 1;
});
}
}),
{
middlewares: [history()]
}
);
store.getState().increment();
(store as any).history.undo();Documentation
You can find the documentation here.
