Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/parsonsmatt/purescript-pux-undo
Convenient undo/redo functionality for your Pux application
https://github.com/parsonsmatt/purescript-pux-undo
Last synced: 29 days ago
JSON representation
Convenient undo/redo functionality for your Pux application
- Host: GitHub
- URL: https://github.com/parsonsmatt/purescript-pux-undo
- Owner: parsonsmatt
- License: other
- Created: 2016-04-02T18:23:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-04-04T16:24:54.000Z (over 8 years ago)
- Last Synced: 2024-09-11T11:18:08.771Z (about 2 months ago)
- Language: PureScript
- Size: 11.7 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `purescript-pux-undo`
This library provides a wrapper that gives you undo and redo for your Pux components.
## Examples:
Suppose you have:
```purescript
module UI whereview :: State -> Html Action
update :: Action -> State -> State
```and you want to give the component undo capability. All you have to do is:
```purescript
module Main whereimport UI as UI
import Pux.Undo as Undomain = do
app <- start
{ view: Undo.simpleView UI.view
, update: fromSimple (Undo.update UI.update)
, inputs: []
, initialState: Undo.initialState UI.initialState
}renderToDOM "#app" app.html
```And that's it!
Check out [the example repository](http://www.github.com/parsonsmatt/purescript-pux-undo-ex).