Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coffee_state_machine

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffee_state_machine - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

2

package.json
{
"name": "coffee_state_machine",
"description": "a finite state machine made in and for coffeescript (javascript)",
"version": "0.3.1",
"version": "0.3.2",
"url": "https://github.com/spearwolf/coffee_state_machine",

@@ -6,0 +6,0 @@ "repository": {

@@ -26,1 +26,48 @@ # coffee_state_machine [![Build Status](https://secure.travis-ci.org/spearwolf/coffee_state_machine.png "Build Status")](http://travis-ci.org/spearwolf/coffee_state_machine)

* written in 100% [CoffeeScript](http://coffeescript.org/)
#### cheat sheet
``` coffeescript
sm = state_machine 'state', (state, event, transition) ->
state.initial 'foo'
state 'plah', ->
one: -> yes
two: -> no
state 'bar', parent: 'plah', enter: (-> "onEnterBar"), exit: (-> "onExitBar"), ->
one: -> no
two: -> yes
event 'boom', ->
transition
plah: foo
bar: plah
transition.from 'foo', to: 'bar', if: -> true, unless: -> false
event 'bang', ->
transition.from ['foo', 'bar'], to: 'bar', action: (oldState, newState) -> "..."
transition.all except: 'bar', only: ['foo'], to: 'plah'
sm.two = 2
sm.boom three: 42
sm.three is 42 # => yes
sm.two() # => yes
sm.state is 'bar' # => yes
sm.is_state('plah') # => yes
```

Sorry, the diff of this file is not supported yet

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