Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injecting nested state value to a behavior #65

Open
pilwon opened this issue Jul 10, 2015 · 1 comment
Open

Injecting nested state value to a behavior #65

pilwon opened this issue Jul 10, 2015 · 1 comment

Comments

@pilwon
Copy link
Contributor

pilwon commented Jul 10, 2015

How do you inject nested state value to a behavior? (ex: $states.get([‘a’, ‘b’] from {states: { a: { b: 1 } } })

@Imti on Slack:

We don't have a good way to do that yet. You'll have to inject a and reach into b to use it from within a behavior

@matthewtoast on Slack:

i would advise sticking to the flattened states for now

@matthewtoast
Copy link
Contributor

This is mostly a question of what API would be appropriate. We could:

  1. do some magic in the build step to allow syntax like function(foo.bar.baz){}
  2. adopt a convention like function(foo__bar__baz){} or function(foo$bar$baz){}
  3. add meta info to behaviors with e.g. function(){}.triggeredBy('foo.bar.baz')

Or something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants