From d9d7a94e35146befcaf035a9f04efa78aa88f69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=A4fer?= Date: Thu, 22 Oct 2015 08:40:06 +0200 Subject: [PATCH] Remove onBeforeSTATE and bump version to 1.3.0. --- README.md | 2 +- Stately.js | 11 +---------- bower.json | 7 ++++--- package.json | 4 ++-- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index dddda62..8f627b4 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/Stately.js b/Stately.js index c3fda2f..1029cb1 100644 --- a/Stately.js +++ b/Stately.js @@ -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) { @@ -75,8 +75,6 @@ var eventName = arguments[1], - onBeforeState, - onEnterState, onLeaveState, @@ -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') { diff --git a/bower.json b/bower.json index 1878231..01fb6bb 100644 --- a/bower.json +++ b/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 ", - "rowan " + "Florian Schäfer ", + "Rowan Udell ", + "Cory Watson " ], "description": "Stately.js is a JavaScript based finite-state machine (FSM) engine for Node.js and the browser.", "keywords": [ diff --git a/package.json b/package.json index 7dcdb80..622a098 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,12 @@ "dependencies": {}, "devDependencies": {}, "contributors": [ - "Rowan Udell (https://github.com/rowanu)", + "Rowan Udell (https://github.com/rowanu)", "Cory Watson (https://github.com/coryandrew1988)" ], "engine": "node >= 0.8.0", "main": "Stately.js", - "version": "1.2.0", + "version": "1.3.0", "directories": { "test": "tests" },