+
Skip to content

hamlim/redocer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redocer

Pronounced: reducer

A custom reducer enhancer that returns a reducer that handles undo and redo actions.

API

import makeRedocer from 'redocer'

function reducer(state, action) { ... };

let redoable = makeRedocer(reducer, initialState);

// Regular actions pass through to the original reducer
redoable(state, 'some-action')
// if you have already called the reducer with a custom action
// then you can call it with a `redo` action, returning the previous state
redoable(state, 'redo')
// Once you have redone a change, you can call the reducer with `undo`
redoable(state, 'undo')

About

A redo-undo reducer enhancer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载