getData() for only that state #48

ghost opened this Issue Jun 12, 2012 · 2 comments


None yet
1 participant

ghost commented Jun 12, 2012

There are times I need to check if there is data stored for only the current state.

That is I don't care if the parent states hold the data with the same name.

Would it make sense to have something like

this.getData('view', false)

to only check for "view" in the current state and not propagate to the parent states if nothing is found?


etgryphon commented Jun 12, 2012

Interesting idea. Kind of breaks the deterministics of a statechart because you are asking the current state of the statechart hierarchy if it has a value and short circuiting it.

I'll have to think about it...


ghost commented Jun 12, 2012

I find some properties are state specific not statechart specific.

Eg. instead of me having to return a closure for wrapping around a variable for only that state it would be simpler to just set the data in that state and know i can retrieve it if it's there and not one from the parent if it's not there.

etgryphon closed this Aug 12, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment