{"action":"created","issue":{"url":"https://api.github.com/repos/yelouafi/redux-saga/issues/269","repository_url":"https://api.github.com/repos/yelouafi/redux-saga","labels_url":"https://api.github.com/repos/yelouafi/redux-saga/issues/269/labels{/name}","comments_url":"https://api.github.com/repos/yelouafi/redux-saga/issues/269/comments","events_url":"https://api.github.com/repos/yelouafi/redux-saga/issues/269/events","html_url":"https://github.com/yelouafi/redux-saga/issues/269","id":150193943,"number":269,"title":"Pattern: Waiting for Stores?","user":{"login":"3LOK","id":1582694,"avatar_url":"https://avatars.githubusercontent.com/u/1582694?v=3","gravatar_id":"","url":"https://api.github.com/users/3LOK","html_url":"https://github.com/3LOK","followers_url":"https://api.github.com/users/3LOK/followers","following_url":"https://api.github.com/users/3LOK/following{/other_user}","gists_url":"https://api.github.com/users/3LOK/gists{/gist_id}","starred_url":"https://api.github.com/users/3LOK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3LOK/subscriptions","organizations_url":"https://api.github.com/users/3LOK/orgs","repos_url":"https://api.github.com/users/3LOK/repos","events_url":"https://api.github.com/users/3LOK/events{/privacy}","received_events_url":"https://api.github.com/users/3LOK/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yelouafi/redux-saga/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-04-21T21:19:33Z","updated_at":"2016-04-27T14:05:58Z","closed_at":"2016-04-27T12:56:53Z","body":"Hi,\r\n\r\nCouldn't find any documentation about this one, so I might be thinking of it completely wrong, but here's my situation, would love to hear some thoughts about it:\r\n\r\nMy app has a login mechanism which eventually can send different actions (FB_LOGIN_SUCCESS, GOOGLE_LOGIN_SUCCESS, ...) that are received by a reducer which stores a computed access-token.\r\n\r\nI have a saga that needs to send a request with the access-token, so what I want to do in pseudo code in many of my different sagas is:\r\n\r\n```\r\naccess-token = [select access token from store]\r\nif [there isn't an access-token] then [wait for the store to have one]\r\n[call api with access-token]\r\n```\r\n\r\nHow can I do the [wait for store to have one]? What is the correct pattern here?\r\n\r\nThanks!\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/yelouafi/redux-saga/issues/comments/215094650","html_url":"https://github.com/yelouafi/redux-saga/issues/269#issuecomment-215094650","issue_url":"https://api.github.com/repos/yelouafi/redux-saga/issues/269","id":215094650,"user":{"login":"yelouafi","id":5453835,"avatar_url":"https://avatars.githubusercontent.com/u/5453835?v=3","gravatar_id":"","url":"https://api.github.com/users/yelouafi","html_url":"https://github.com/yelouafi","followers_url":"https://api.github.com/users/yelouafi/followers","following_url":"https://api.github.com/users/yelouafi/following{/other_user}","gists_url":"https://api.github.com/users/yelouafi/gists{/gist_id}","starred_url":"https://api.github.com/users/yelouafi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yelouafi/subscriptions","organizations_url":"https://api.github.com/users/yelouafi/orgs","repos_url":"https://api.github.com/users/yelouafi/repos","events_url":"https://api.github.com/users/yelouafi/events{/privacy}","received_events_url":"https://api.github.com/users/yelouafi/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T14:05:58Z","updated_at":"2016-04-27T14:05:58Z","body":"Hmm... This remind me of Wait conditions in Java: Wait until a condition on the store is met (regardless of the different possible action pathes causing the state change) "}}