@zag-js/core
Advanced tools
Comparing version 0.0.0-dev-20220425184023 to 0.0.0-dev-20220426065739
{ | ||
"name": "@zag-js/core", | ||
"version": "0.0.0-dev-20220425184023", | ||
"version": "0.0.0-dev-20220426065739", | ||
"description": "A minimal implementation of xstate fsm for UI machines", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/utils": "^0.0.0-dev-20220425184023", | ||
"@zag-js/utils": "^0.0.0-dev-20220426065739", | ||
"klona": "^2.0.5", | ||
@@ -43,0 +43,0 @@ "valtio": "^1.5.2" |
@@ -17,3 +17,3 @@ # @zag-js/core | ||
- Transition actions | ||
- Boolean guard helpers | ||
- Boolean guard helpers (`and`, `or`, `not`) | ||
- Basic spawn helpers | ||
@@ -31,2 +31,4 @@ - Activities (for state nodes) | ||
npm i @zag-js/core | ||
# or | ||
yarn add @zag-js/core | ||
``` | ||
@@ -135,5 +137,5 @@ | ||
- `target?` (string) - the state name to transition to. | ||
- `actions?` (Action | Action[]) - the [action(s)](#action-config) to execute when this transition is taken. | ||
- `guard?` (Guard) - the condition (predicate function) to test. If it returns `true`, the transition will be taken. | ||
- `target` (string) - the state name to transition to. | ||
- `actions` (Action | Action[]) - the [action(s)](#action-config) to execute when this transition is taken. | ||
- `guard` (Guard) - the condition (predicate function) to test. If it returns `true`, the transition will be taken. | ||
@@ -149,18 +151,5 @@ ### Machine options | ||
Function syntax: | ||
The action function to execute while transitioning from one state to another. It takes the following arguments: | ||
- (function) - the action function to execute. Resolves to `{ type: actionFn.name, exec: actionFn }` and the function | ||
takes the following arguments: | ||
1. `context` (any) - the machine's current `context`. | ||
2. `event` (object) - the event that caused the action to be executed. | ||
Object syntax: | ||
- `type` (string) - the action type. | ||
- `exec?` (function) - the action function to execute. | ||
String syntax: | ||
- (string) - the action type. | ||
- By default it resolves to `{ type: actionType, exec: undefined }`. It can resolve to resolved function or resolved | ||
object action **if** the action can be looked up in the `options.actions` object. | ||
- `context` (any) - the machine's current `context`. | ||
- `event` (object) - the event that caused the action to be executed. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
221561
152