@coaction/history
v1.5.0
Published
A undo/redo middleware for Coaction
Maintainers
Readme
@coaction/history
A undo/redo middleware for Coaction.
Installation
You can install it via npm, yarn or pnpm.
npm install 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.
