{"action":"created","issue":{"url":"https://api.github.com/repos/ngrx/store/issues/343","repository_url":"https://api.github.com/repos/ngrx/store","labels_url":"https://api.github.com/repos/ngrx/store/issues/343/labels{/name}","comments_url":"https://api.github.com/repos/ngrx/store/issues/343/comments","events_url":"https://api.github.com/repos/ngrx/store/issues/343/events","html_url":"https://github.com/ngrx/store/issues/343","id":210310180,"number":343,"title":"state snapshot","user":{"login":"ghetolay","id":1864528,"avatar_url":"https://avatars1.githubusercontent.com/u/1864528?v=3","gravatar_id":"","url":"https://api.github.com/users/ghetolay","html_url":"https://github.com/ghetolay","followers_url":"https://api.github.com/users/ghetolay/followers","following_url":"https://api.github.com/users/ghetolay/following{/other_user}","gists_url":"https://api.github.com/users/ghetolay/gists{/gist_id}","starred_url":"https://api.github.com/users/ghetolay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghetolay/subscriptions","organizations_url":"https://api.github.com/users/ghetolay/orgs","repos_url":"https://api.github.com/users/ghetolay/repos","events_url":"https://api.github.com/users/ghetolay/events{/privacy}","received_events_url":"https://api.github.com/users/ghetolay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-02-26T11:17:43Z","updated_at":"2017-03-09T09:27:35Z","closed_at":null,"body":"Sometimes we need to simply access the current state and not react to it.\r\nTo do so, we still have to use observable like :\r\n\r\n```\r\nthis.store.select( selector )\r\n  .take(1)\r\n  .subscribe( ... );\r\n```\r\n\r\nor in effects : \r\n\r\n```\r\nthis.actions$\r\n  .withLatestFrom( this.store.select( selector ) )\r\n```\r\n\r\nBut it really seems like doing complicated things to achieve a simple task.\r\nWould it be really bad if we could access the state directly ??\r\n\r\nI've created an hacky `getStateSnapshot( selector )` in some of my effects to experiment and didn't come into any trouble yet.  "},"comment":{"url":"https://api.github.com/repos/ngrx/store/issues/comments/285299812","html_url":"https://github.com/ngrx/store/issues/343#issuecomment-285299812","issue_url":"https://api.github.com/repos/ngrx/store/issues/343","id":285299812,"user":{"login":"karolmie1","id":9072936,"avatar_url":"https://avatars0.githubusercontent.com/u/9072936?v=3","gravatar_id":"","url":"https://api.github.com/users/karolmie1","html_url":"https://github.com/karolmie1","followers_url":"https://api.github.com/users/karolmie1/followers","following_url":"https://api.github.com/users/karolmie1/following{/other_user}","gists_url":"https://api.github.com/users/karolmie1/gists{/gist_id}","starred_url":"https://api.github.com/users/karolmie1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karolmie1/subscriptions","organizations_url":"https://api.github.com/users/karolmie1/orgs","repos_url":"https://api.github.com/users/karolmie1/repos","events_url":"https://api.github.com/users/karolmie1/events{/privacy}","received_events_url":"https://api.github.com/users/karolmie1/received_events","type":"User","site_admin":false},"created_at":"2017-03-09T09:27:35Z","updated_at":"2017-03-09T09:27:35Z","body":"@fxck What are those better ways? Can you show me where I should look for them?\r\nSometimes I want to have a snapshot, and sometimes I want a subscription.\r\nIt would be great if such native function existed.\r\nIf it's hard to do, simple alias for select(...).take(1) would be nice.\r\n"}}
{"actor":{"display_login":"karolmie1"}}