Skip to content

Commit

Permalink
Remove onBeforeSTATE and bump version to 1.3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
fschaefer committed Oct 22, 2015
1 parent f6c14a3 commit d9d7a94
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -239,7 +239,7 @@ Inside the `notification`, `this` refers to the internal `stateStore`.

Beside the notification system via `bind` and `unbind`, there is an alternative
way to attach hooks that are triggered when the state of the machine changes.
Possible hooks are `onbeforeSTATE`, `onenterSTATE` (or as shortcut `onSTATE`)
Possible hooks are `onenterSTATE` (or as shortcut `onSTATE`)
and `onleaveSTATE` for states and `onbeforeEVENT` and `onafterEVENT` for
events. Hook functions have the same signature as notifications bound with
`bind`.
Expand Down
11 changes: 1 addition & 10 deletions Stately.js
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2012 Florian Schäfer (florian.schaefer@gmail.com)
* Released under MIT license.
*
* Version: 1.2.0
* Version: 1.3.0
*
*/
(function (root, factory) {
Expand Down Expand Up @@ -75,8 +75,6 @@
var
eventName = arguments[1],

onBeforeState,

onEnterState,

onLeaveState,
Expand All @@ -96,13 +94,6 @@

currentState = nextState;

onBeforeState = stateMachine['onbefore' + currentState.name];

if (onBeforeState && typeof onBeforeState === 'function') {

onBeforeState.call(stateStore, eventName, lastState.name, nextState.name);
}

onEnterState = stateMachine['onenter' + currentState.name] || stateMachine['on' + currentState.name];

if (onEnterState && typeof onEnterState === 'function') {
Expand Down
7 changes: 4 additions & 3 deletions bower.json
@@ -1,11 +1,12 @@
{
"name": "Stately.js",
"main": "Stately.js",
"version": "1.2.0",
"version": "1.3.0",
"homepage": "https://github.com/fschaefer/Stately.js",
"authors": [
"Florian Schäfer <florian.schaefer+github@gmail.com>",
"rowan <rowanu@gmail.com>"
"Florian Schäfer <florian.schaefer@gmail.com>",
"Rowan Udell <rowanu@gmail.com>",
"Cory Watson <cory.andrew.1988@gmail.com>"
],
"description": "Stately.js is a JavaScript based finite-state machine (FSM) engine for Node.js and the browser.",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -21,12 +21,12 @@
"dependencies": {},
"devDependencies": {},
"contributors": [
"Rowan Udell (https://github.com/rowanu)",
"Rowan Udell <rowanu@gmail.com> (https://github.com/rowanu)",
"Cory Watson <cory.andrew.1988@gmail.com> (https://github.com/coryandrew1988)"
],
"engine": "node >= 0.8.0",
"main": "Stately.js",
"version": "1.2.0",
"version": "1.3.0",
"directories": {
"test": "tests"
},
Expand Down

0 comments on commit d9d7a94

Please sign in to comment.