fn-machine
Advanced tools
Comparing version 0.0.17 to 0.1.0
{ | ||
"name": "fn-machine", | ||
"version": "0.0.17", | ||
"version": "0.1.0", | ||
"description": "a tiny functional state machine", | ||
@@ -14,4 +14,4 @@ "main": "index", | ||
"type-check": "tsc --noEmit", | ||
"release": "npm run type-check && np", | ||
"build-typings": "tsc -p tsconfig-typings.json" | ||
"release": "npm run type-check && npm run build-typings && np", | ||
"build-typings": "rimraf **/*.d.ts && tsc -p tsconfig-typings.json" | ||
}, | ||
@@ -36,2 +36,3 @@ "repository": { | ||
"np": "^6.5.0", | ||
"rimraf": "^3.0.2", | ||
"sinon": "^7.3.2", | ||
@@ -38,0 +39,0 @@ "typescript": "^3.8.3" |
@@ -17,3 +17,5 @@ /** @typedef {import('./fn-state').CurrentState} CurrentState */ | ||
let context = Object.assign({}, initialContext); | ||
// get initial state, run it's enter function if necessary | ||
const first = states.find(s => s.name === initialState); | ||
first && first.enter && first.enter(); | ||
return function send(event, detail = {}) { | ||
@@ -20,0 +22,0 @@ loggerFn(`sent '${event}'`); |
14930
280
7