You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to extract state classes into their own file, but the examples all show the state class being declared on the fly and extending this. Is this a required pattern?
The text was updated successfully, but these errors were encountered:
Coming back to states, they mainly depend on class expressions and context resolution of static methods:
static_states(){return[classMyFirstStateextendsthis{_handleEnter(){// overwrites root function when we are on this state}}]}
which could also be represented like that:
conststateFactory=function(cls){returnclassMyFirstStateextendscls{_handleEnter(){// overwrites root function when we are on this state}}}static_states(){return[stateFactory(this)]}
So, while following examples is probably safest way to avoid potential issues e.g. with context resolution, it is by no means enforced.
I would like to extract state classes into their own file, but the examples all show the state class being declared on the fly and extending
this
. Is this a required pattern?The text was updated successfully, but these errors were encountered: