From eebc78841fafa4774f862ebe4bce77a075ca1ff7 Mon Sep 17 00:00:00 2001 From: John Haugeland Date: Sun, 7 May 2017 15:44:02 -0700 Subject: [PATCH] history in config, rename jssm internal instance to machine --- package.json | 2 +- src/js/jssm-types.js | 4 +++- src/js/jssm.js | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0f7388db..88ef82c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jssm", - "version": "0.6.0", + "version": "0.6.1", "description": "A Javascript state machine with a simple API. Well tested, and typed with Flowtype. MIT License.", "main": "dist/jssm.es5.browserified.js", "scripts": { diff --git a/src/js/jssm-types.js b/src/js/jssm-types.js index be6f70e3..8dce3283 100644 --- a/src/js/jssm-types.js +++ b/src/js/jssm-types.js @@ -43,7 +43,9 @@ type JssmGenericMachine = { allow_empty? : boolean, allow_islands? : boolean, - allow_force? : boolean + allow_force? : boolean, + + keep_history? : boolean | number }; diff --git a/src/js/jssm.js b/src/js/jssm.js index 56f1b7b9..17e07996 100644 --- a/src/js/jssm.js +++ b/src/js/jssm.js @@ -17,7 +17,7 @@ const new_machine = (props:mixed) : JssmMachine => { -class jssm { +class machine { constructor({ transitions } : JssmConfig) { @@ -134,6 +134,8 @@ class jssm { export { + machine, + new_machine, version