{"action":"closed","issue":{"url":"https://api.github.com/repos/mweststrate/mobservable/issues/21","labels_url":"https://api.github.com/repos/mweststrate/mobservable/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/mweststrate/mobservable/issues/21/comments","events_url":"https://api.github.com/repos/mweststrate/mobservable/issues/21/events","html_url":"https://github.com/mweststrate/mobservable/issues/21","id":102398020,"number":21,"title":"Why is 'onInvalidate' only called once (in observeUntilInvalid) ","user":{"login":"mehdi-cit","id":2162107,"avatar_url":"https://avatars.githubusercontent.com/u/2162107?v=3","gravatar_id":"","url":"https://api.github.com/users/mehdi-cit","html_url":"https://github.com/mehdi-cit","followers_url":"https://api.github.com/users/mehdi-cit/followers","following_url":"https://api.github.com/users/mehdi-cit/following{/other_user}","gists_url":"https://api.github.com/users/mehdi-cit/gists{/gist_id}","starred_url":"https://api.github.com/users/mehdi-cit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehdi-cit/subscriptions","organizations_url":"https://api.github.com/users/mehdi-cit/orgs","repos_url":"https://api.github.com/users/mehdi-cit/repos","events_url":"https://api.github.com/users/mehdi-cit/events{/privacy}","received_events_url":"https://api.github.com/users/mehdi-cit/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-21T14:57:47Z","updated_at":"2015-08-21T20:28:17Z","closed_at":"2015-08-21T20:28:17Z","body":"Hello,\r\nI'm trying to see how to use mobservable to 'intelligently' and efficiently listen to state changes and identified observeUntilInvalid as a plosible 'candidate' to use.\r\nobserveUntilInvalid( functionToObserve, onInvalidate )\r\nwhen it \"evaluates\" that 'functionToObserve' has a different 'outcome' it runs  onInvalidate. However, this only happens once!!! subsequent changes to state that would lead to a different outcome of functionToObserve no longer cause onInvalidate to be ran.\r\nWhy is that? Any clues on how to achieve the above scenario? \r\nhttps://github.com/mweststrate/mobservable/blob/master/docs/api.md#observeuntilinvalidfunctiontoobserve-oninvalidate\r\n\r\nPS: \r\nI can see starting line  813 //mobservable.reactiveMixin \r\nit's indeed using observeUntilInvalid within componentWillMount.\r\nBut how would that work if componentWillMount is only run when the component is mounted (At least that's implied by its name). It (the 'onInvalidate' function that causes update => '_this.forceUpdate()') won't be re-run when state changes. I must be missing something."}}