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

Passing an initialized collection to a State constructor #43

Closed
jrmyio opened this issue Aug 11, 2014 · 3 comments
Closed

Passing an initialized collection to a State constructor #43

jrmyio opened this issue Aug 11, 2014 · 3 comments
Labels

Comments

@jrmyio
Copy link

jrmyio commented Aug 11, 2014

When you pass an initialized collection to a State constructor it won't detect that the collection is already initialized. Instead it will read it as an object and wrap it in a new collection.

Is there a way to bypass the auto-initialization in constructors.
Could this be achieved by type-checking?

Example which does not work:
var myCollection = new MyCollection();
var myState = new MyState({someChildCollection: myCollection });

Exampe that does work:
var myCollection = new MyCollection();
var myState = new MyState();
myState.someChildCollection = myCollection;

@jrmyio
Copy link
Author

jrmyio commented Aug 12, 2014

This might be a copy of or related to #31

@mmacaula
Copy link
Contributor

mmacaula commented Nov 5, 2014

I've got a piece of code that documents this in a runnable way here as I have also run into this. The code is here. Hopefully this helps

@pgilad
Copy link
Member

pgilad commented Oct 17, 2015

Closing this as this is dated almost a year ago. Feel free to re-open

@pgilad pgilad closed this as completed Oct 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants