@zag-js/core
Advanced tools
Comparing version 0.0.0-dev-20220707125149 to 0.0.0-dev-20220712092426
@@ -308,14 +308,2 @@ "use strict"; | ||
this.status = "Running" /* Running */; | ||
const event = toEvent("machine.init" /* Init */); | ||
const initTarget = isObject(init) ? init.value : init; | ||
const initContext = isObject(init) ? init.context : void 0; | ||
if (initContext) { | ||
this.setContext(initContext); | ||
} | ||
const transition = { | ||
target: initTarget != null ? initTarget : this.config.initial | ||
}; | ||
const next = this.getNextStateInfo(transition, event); | ||
this.initialState = next; | ||
this.performStateChangeEffects(this.state.value, next, event); | ||
this.removeStateListener = (0, import_store3.subscribe)(this.state, () => { | ||
@@ -341,2 +329,14 @@ this.stateListeners.forEach((listener) => { | ||
this.executeActions(this.config.entry, toEvent("machine.start" /* Start */)); | ||
const event = toEvent("machine.init" /* Init */); | ||
const target = isObject(init) ? init.value : init; | ||
const context = isObject(init) ? init.context : void 0; | ||
if (context) { | ||
this.setContext(context); | ||
} | ||
const transition = { | ||
target: target != null ? target : this.config.initial | ||
}; | ||
const next = this.getNextStateInfo(transition, event); | ||
this.initialState = next; | ||
this.performStateChangeEffects(this.state.value, next, event); | ||
return this; | ||
@@ -357,3 +357,3 @@ }); | ||
this.executeActions(this.config.exit, toEvent("machine.stop" /* Stop */)); | ||
this.setState(null); | ||
this.setState(""); | ||
this.setEvent("machine.stop" /* Stop */); | ||
@@ -623,2 +623,4 @@ this.stopStateListeners(); | ||
const currentState = this.state.value; | ||
if (currentState === "") | ||
return; | ||
const stateNode = current ? this.getStateNode(current) : void 0; | ||
@@ -625,0 +627,0 @@ this.stopActivities(currentState); |
{ | ||
"name": "@zag-js/core", | ||
"version": "0.0.0-dev-20220707125149", | ||
"version": "0.0.0-dev-20220712092426", | ||
"description": "A minimal implementation of xstate fsm for UI machines", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/store": "0.0.0-dev-20220707125149", | ||
"@zag-js/store": "0.1.0", | ||
"@zag-js/utils": "0.1.2", | ||
@@ -43,0 +43,0 @@ "klona": "2.0.5" |
Sorry, the diff of this file is not supported yet
91466
2084
+ Added@zag-js/store@0.1.0(transitive)
- Removed@zag-js/store@0.0.0-dev-20220707125149(transitive)
Updated@zag-js/store@0.1.0