Skip to content

Convenient undo/redo functionality for your Pux application

License

Notifications You must be signed in to change notification settings

parsonsmatt/purescript-pux-undo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purescript-pux-undo

This library provides a wrapper that gives you undo and redo for your Pux components.

Examples:

Suppose you have:

module UI where

view :: State -> Html Action
update :: Action -> State -> State

and you want to give the component undo capability. All you have to do is:

module Main where

import UI as UI
import Pux.Undo as Undo

main = 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.

About

Convenient undo/redo functionality for your Pux application

Resources

License

Stars

Watchers

Forks

Packages

No packages published