{"action":"created","issue":{"url":"https://api.github.com/repos/reflux/refluxjs/issues/395","labels_url":"https://api.github.com/repos/reflux/refluxjs/issues/395/labels{/name}","comments_url":"https://api.github.com/repos/reflux/refluxjs/issues/395/comments","events_url":"https://api.github.com/repos/reflux/refluxjs/issues/395/events","html_url":"https://github.com/reflux/refluxjs/pull/395","id":100628722,"number":395,"title":"Reflux.connectFilter: Re-filter listenable when this.props changes","user":{"login":"robert-chiniquy","id":623808,"avatar_url":"https://avatars.githubusercontent.com/u/623808?v=3","gravatar_id":"","url":"https://api.github.com/users/robert-chiniquy","html_url":"https://github.com/robert-chiniquy","followers_url":"https://api.github.com/users/robert-chiniquy/followers","following_url":"https://api.github.com/users/robert-chiniquy/following{/other_user}","gists_url":"https://api.github.com/users/robert-chiniquy/gists{/gist_id}","starred_url":"https://api.github.com/users/robert-chiniquy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robert-chiniquy/subscriptions","organizations_url":"https://api.github.com/users/robert-chiniquy/orgs","repos_url":"https://api.github.com/users/robert-chiniquy/repos","events_url":"https://api.github.com/users/robert-chiniquy/events{/privacy}","received_events_url":"https://api.github.com/users/robert-chiniquy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-12T20:33:09Z","updated_at":"2015-08-14T20:37:46Z","closed_at":"2015-08-14T20:37:46Z","pull_request":{"url":"https://api.github.com/repos/reflux/refluxjs/pulls/395","html_url":"https://github.com/reflux/refluxjs/pull/395","diff_url":"https://github.com/reflux/refluxjs/pull/395.diff","patch_url":"https://github.com/reflux/refluxjs/pull/395.patch"},"body":"This change is premised on the assumption that callers will reference `this.props` in their `filterFunc`s, and expect the component's state to reflect changes in `this.props` regardless of if the store has triggered again. I do not think the current behavior is incorrect primarily because of ambiguity in the docs, but in this example from the README:\r\n\r\n```javascript\r\n    mixins: [Reflux.connectFilter(postStore, \"post\", function(posts) {\r\n        return posts.filter(function(post) {\r\n           return post.id === this.props.id;\r\n        }.bind(this))[0];\r\n    })],\r\n```\r\n\r\n… The component's state will only be correct if `this.props.id` never changes. \r\n\r\nIn the case of stores which present collections, and components using `Reflux.connectFilter` on them filtering via `this.props`, in my case `this.props.params`, the expected behavior IMO is that the component's state will update when `this.props.params` changes. \r\n\r\nIt seemed to me that `componentWillUpdate` was the best place to locate that, but maybe `componentWillReceiveProps` is better.\r\n\r\nI wasn't sure how to add a good test for this in the test suite. "},"comment":{"url":"https://api.github.com/repos/reflux/refluxjs/issues/comments/131233681","html_url":"https://github.com/reflux/refluxjs/pull/395#issuecomment-131233681","issue_url":"https://api.github.com/repos/reflux/refluxjs/issues/395","id":131233681,"user":{"login":"robert-chiniquy","id":623808,"avatar_url":"https://avatars.githubusercontent.com/u/623808?v=3","gravatar_id":"","url":"https://api.github.com/users/robert-chiniquy","html_url":"https://github.com/robert-chiniquy","followers_url":"https://api.github.com/users/robert-chiniquy/followers","following_url":"https://api.github.com/users/robert-chiniquy/following{/other_user}","gists_url":"https://api.github.com/users/robert-chiniquy/gists{/gist_id}","starred_url":"https://api.github.com/users/robert-chiniquy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robert-chiniquy/subscriptions","organizations_url":"https://api.github.com/users/robert-chiniquy/orgs","repos_url":"https://api.github.com/users/robert-chiniquy/repos","events_url":"https://api.github.com/users/robert-chiniquy/events{/privacy}","received_events_url":"https://api.github.com/users/robert-chiniquy/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T20:37:46Z","updated_at":"2015-08-14T20:37:46Z","body":"Well, this seems important to do, but not sure how to do it without changing the interface to `Reflux.connectFilter` to take `props` as well."}}