{"action":"created","issue":{"url":"https://api.github.com/repos/jhollingworth/marty/issues/239","labels_url":"https://api.github.com/repos/jhollingworth/marty/issues/239/labels{/name}","comments_url":"https://api.github.com/repos/jhollingworth/marty/issues/239/comments","events_url":"https://api.github.com/repos/jhollingworth/marty/issues/239/events","html_url":"https://github.com/jhollingworth/marty/issues/239","id":65031556,"number":239,"title":"Context and `for` is not clear (to me at least)","user":{"login":"matthewgertner","id":870558,"avatar_url":"https://avatars.githubusercontent.com/u/870558?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewgertner","html_url":"https://github.com/matthewgertner","followers_url":"https://api.github.com/users/matthewgertner/followers","following_url":"https://api.github.com/users/matthewgertner/following{/other_user}","gists_url":"https://api.github.com/users/matthewgertner/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewgertner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewgertner/subscriptions","organizations_url":"https://api.github.com/users/matthewgertner/orgs","repos_url":"https://api.github.com/users/matthewgertner/repos","events_url":"https://api.github.com/users/matthewgertner/events{/privacy}","received_events_url":"https://api.github.com/users/matthewgertner/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jhollingworth/marty/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-29T07:04:22Z","updated_at":"2015-03-29T11:51:12Z","closed_at":null,"body":"The documentation explains that the different contexts have different instances of the registered objects (e.g. Stores, Action Creators) and that they are needed for isomorphic applications (presumably because the server and browser might have different contexts).\r\n\r\nMy application is hosted entirely in the browser, so it's not clear to me why I have to worry about the context at all. However, I observed the following. I defined a container like this:\r\n\r\n```\r\nmodule.exports = Marty.createContainer(MyComponent, {\r\n  listenTo: MyStore,\r\n  fetch: {\r\n    someProp() {\r\n      return MyStore.for(this).getSomeProp();\r\n    }\r\n  }\r\n});\r\n```\r\n\r\nThis behaves as expected: if `someProp` must be retrieved asynchronously by the store, the first call returns a fetch result with the state set to `PENDING`. When the state changes to `DONE`, the value is retrieved and the component is rendered. \r\n\r\nHowever, if I omit the `for(this)` then the fetch result is returned directly by `getSomeProp`, so I have to check the state myself and retrieve the `result` property manually (i.e. `getSomeProp().result`) when it is available.\r\n\r\nWhat am I missing? Why does `for(this)` need to be used in this case and why does it behave as I described when `for(this)` is omitted?"},"comment":{"url":"https://api.github.com/repos/jhollingworth/marty/issues/comments/87402367","html_url":"https://github.com/jhollingworth/marty/issues/239#issuecomment-87402367","issue_url":"https://api.github.com/repos/jhollingworth/marty/issues/239","id":87402367,"user":{"login":"jhollingworth","id":151172,"avatar_url":"https://avatars.githubusercontent.com/u/151172?v=3","gravatar_id":"","url":"https://api.github.com/users/jhollingworth","html_url":"https://github.com/jhollingworth","followers_url":"https://api.github.com/users/jhollingworth/followers","following_url":"https://api.github.com/users/jhollingworth/following{/other_user}","gists_url":"https://api.github.com/users/jhollingworth/gists{/gist_id}","starred_url":"https://api.github.com/users/jhollingworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhollingworth/subscriptions","organizations_url":"https://api.github.com/users/jhollingworth/orgs","repos_url":"https://api.github.com/users/jhollingworth/repos","events_url":"https://api.github.com/users/jhollingworth/events{/privacy}","received_events_url":"https://api.github.com/users/jhollingworth/received_events","type":"User","site_admin":false},"created_at":"2015-03-29T11:51:11Z","updated_at":"2015-03-29T11:51:11Z","body":"I've just added a couple of tests to check if the behaviour changes when using `.for` but seems in the browser `MyStore.for(this) === MyStore`. Is there anything else special you are doing? Also are you using Marty v0.9.4?"}}