heycarsten / ember-fsm Goto Github PK
View Code? Open in Web Editor NEW[Maintenance Mode] A promise-aware finite state machine implementation for Ember
License: MIT License
[Maintenance Mode] A promise-aware finite state machine implementation for Ember
License: MIT License
heycarsten
!
I may be being a silly boy, but it appears that willExit
and didExit
run on entering a state.
/* Begin State Machine Definition */
fsmEvents: {
toIdentity: {
transition: {
from: '$all',
to: 'identity'
willExit() { console.log('i ran when entering the identity state! ...') },
didExit() { console.log('...then i also ran when entering the identity state!') }
}
},
},
This is being used in an FSM#Stateful
service.
I was hoping to use willExit()
to return a promise that will authenticate the current user when attempting a transition from the identity step. Am I being a silly boy??
Hope you're great Carsten!! Miss you man
Ensure Ember FSM can be used easily in Ember CLI projects.
My usecase for the FSM is a workflow manager for tasks. I'd love to persist the current state into a DB and revive the FSM later to promote the item. Being able to set currentState
on init will allow for this. Or am I on the wrong track and is this feature already possible?
There's probably a good reason for this, but I was hoping to do:
fsmEvents: {
toCart: {
transition: { $all: 'cart' }
}
Instead I need to do:
fsmEvents: {
toCart: {
transition: {
from: ['$initial', '$all'],
to: 'cart'
}
}
}
Feels like $all should include $initial - but maybe I'm missing something?
Hi, just checking if this message reaches any other maintainers of this repo / package that Carsten might have added prior to his passing in 2019.
I am not aware of any other maintainers but wanted to verify as I am working on minimal updates to provide compatibility with Ember 4.x / Octane (purely to aid in the upgrade process in an Ember app that still uses this library for now). If there are, I could submit a PR, otherwise my intention is to publish a fork in the next few days.
just updated an addon that uses this to CLI 0.0.23 (which includes a package for addons that forces ember to disable prototype extensions, to ensure max compatibility)
Noticed ember-fsm uses .contains
Just flagging this, shouldn't be too hard
I love the automatic isInXXX
properties, it's genius for logic in templates. It would be really nice to have canXXX
properties too. XXX is replaced with the name of a transition.
This allows for templates to add action buttons when these actions are available.
What is your opinion, is this hard to implement?
I think recomputing the guards will be hard though.
Using the Stateful mixin in a component results in the error "Uncaught TypeError: this.currentState.legacyPropertyDidChange is not a function", as reported at emberjs/ember.js#11374
Hi,
it would be great if a function would be accepted as initialState to properly sync the FSM with a model that comes with a state and is persisted.
Best,
Tobias
Ember changed its use of the states
property, particularly in views. After upgrading 1.7 -> 1.8, my app is peppered with
DEPRECATION: Usage of
states
is deprecated, use_states
instead.
This particularly conflicts if I mix Ember.FSM.Stateful
into a component (a view). ember-fsm
's states
property conflicts with CoreView
's, resulting in
TypeError: Cannot read property 'enter' of undefined.
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.