New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jeux-undo

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jeux-undo

Undo and Redo functionality for jeux apps

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Jeux-Undo

Adds undo and redo to Jeux applications

Installation

npm install jeux-undo

Usage

import {undoRedo} from "jeux-undo"

// counter reducer
function counter (state = 0, action){
    if(action.type ==="INC"){
        return state + 1
    }
    if(action.type === "DEC"){
        return state - 1;
    }
    return state;
}

export undoCounter = undoRedo(counter);


// seperate file
// instance of jeux store
// mock state
const state = {
    counter: 0
}
store.dispatch({type : "INC"})
// state.counter has a value of 1
store.dispatch({type : "UNDO"})
// state.counter has a value of 0

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

FAQs

Package last updated on 16 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc