{"action":"created","issue":{"url":"https://api.github.com/repos/rematch/rematch/issues/556","repository_url":"https://api.github.com/repos/rematch/rematch","labels_url":"https://api.github.com/repos/rematch/rematch/issues/556/labels{/name}","comments_url":"https://api.github.com/repos/rematch/rematch/issues/556/comments","events_url":"https://api.github.com/repos/rematch/rematch/issues/556/events","html_url":"https://github.com/rematch/rematch/issues/556","id":373826108,"node_id":"MDU6SXNzdWUzNzM4MjYxMDg=","number":556,"title":"how to load initial state asynchronously","user":{"login":"nyrf","id":299532,"node_id":"MDQ6VXNlcjI5OTUzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/299532?v=4","gravatar_id":"","url":"https://api.github.com/users/nyrf","html_url":"https://github.com/nyrf","followers_url":"https://api.github.com/users/nyrf/followers","following_url":"https://api.github.com/users/nyrf/following{/other_user}","gists_url":"https://api.github.com/users/nyrf/gists{/gist_id}","starred_url":"https://api.github.com/users/nyrf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyrf/subscriptions","organizations_url":"https://api.github.com/users/nyrf/orgs","repos_url":"https://api.github.com/users/nyrf/repos","events_url":"https://api.github.com/users/nyrf/events{/privacy}","received_events_url":"https://api.github.com/users/nyrf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-25T08:17:51Z","updated_at":"2018-10-25T17:48:59Z","closed_at":null,"author_association":"NONE","body":"```js\r\nconst getCount = async () => {\r\n  const result = await api.getCount()\r\n  return result\r\n}\r\nexport const count = {\r\n  state: getResult(),\r\n  reducers: {\r\n    increment: s => s + 1,\r\n    decrement: s => s - 1,\r\n    up: (s, num) => s + num\r\n  },\r\n  effects: dispatch => ({\r\n    async asyncIncrement() {\r\n      await new Promise(resolve => {\r\n        setTimeout(resolve, 1000)\r\n      })\r\n\r\n      dispatch.count.increment()\r\n    },\r\n  }),\r\n}\r\n```\r\nthe code seems not work. any plugin? Thanks."},"comment":{"url":"https://api.github.com/repos/rematch/rematch/issues/comments/433144461","html_url":"https://github.com/rematch/rematch/issues/556#issuecomment-433144461","issue_url":"https://api.github.com/repos/rematch/rematch/issues/556","id":433144461,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzE0NDQ2MQ==","user":{"login":"nyrf","id":299532,"node_id":"MDQ6VXNlcjI5OTUzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/299532?v=4","gravatar_id":"","url":"https://api.github.com/users/nyrf","html_url":"https://github.com/nyrf","followers_url":"https://api.github.com/users/nyrf/followers","following_url":"https://api.github.com/users/nyrf/following{/other_user}","gists_url":"https://api.github.com/users/nyrf/gists{/gist_id}","starred_url":"https://api.github.com/users/nyrf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyrf/subscriptions","organizations_url":"https://api.github.com/users/nyrf/orgs","repos_url":"https://api.github.com/users/nyrf/repos","events_url":"https://api.github.com/users/nyrf/events{/privacy}","received_events_url":"https://api.github.com/users/nyrf/received_events","type":"User","site_admin":false},"created_at":"2018-10-25T17:48:59Z","updated_at":"2018-10-25T17:48:59Z","author_association":"NONE","body":"Sorry for my weak english.  i want to load shop cart info from database, the api \r\n```json\r\n{data: [{id: 1, name:' name', count: 10}, {id: 2, name:' name', count: 1}]}\r\n```\r\nin models.js,\r\n```json\r\n state: []\r\n```\r\ni want to load cart from the api. any way? thanks."}}
{"actor":{"display_login":"nyrf"}}