simplystated / f-of-xstate Goto Github PK
View Code? Open in Web Editor NEWTools for operating on xstate state machines as data by Simply Stated
Home Page: https://www.simplystated.dev
License: MIT License
Tools for operating on xstate state machines as data by Simply Stated
Home Page: https://www.simplystated.dev
License: MIT License
It's awkward that we only get state references for transition targets. Sometimes we want the state ids.
Hello, I was just recently recommended to try this and I'm happy with the results so far. I have a question though, I'm trying to add an entry action and exit action to every state like the following:
const opts = { actions: { Enter: ..., Exit: ... } }
const config = mapStates(machine2, (state) => ({
...state,
meta: {
newID: state.id
},
entry: 'Enter', // <-- Errors here
exit: 'Exit' // <-- Errors here
}))
However I get this error:
Type 'string' is not assignable to type 'ActionObject<unknown, AnyEventObject>[]'.ts(2322)
types.d.ts(447, 5): The expected type comes from property 'entry' which is declared here on type 'StructuredTransformedStateNodeConfig<unknown, any, AnyEventObject>'
How would I get the entry and exit functions to work on all of my states?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.