{"action":"created","comment":{"url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/comments/165227962","pull_request_review_id":93131686,"id":165227962,"diff_hunk":"@@ -139,38 +139,57 @@ await waitForActions(store, [\n ]);\n ```\n \n-### Example #3: function (advanced use cases)\n+### Example #3: custom action matcher (advanced use cases)\n \n-Supply a predicate which will be called for every action dispatched.\n+Supply a matcher function which will be called for every action dispatched. The function accepts two arguments: the array of expected actions and dispatched actions.\n \n ```js\n import waitForActions from 'redux-mock-store-await-actions';\n import configureStore from 'redux-mock-store';\n import thunkMiddleware from 'redux-thunk';\n \n const store = configureStore([thunkMiddleware])();\n+const expectedActions = [\n+    { type: 'LOGIN_START', payload: { username, password } },\n+    { type: 'FETCH_ORDERS_SUCCESS' }\n+];\n \n-store.dispatch(login('my-username', '123'));\n-await waitForActions(store, (storeActions) => {\n-\tconst hasLoginStart = storeActions.some((item) => item.type === 'LOGIN_START' && item.payload.username === 'my-username');\n-    const hasFetchOrdersSuccess = storeActions.some((item) => item.type === 'FETCH_ORDERS_SUCCESS');\n+store.dispatch(login('my-username', 'my-password'));\n+// Matches and LOGIN_START and FETCH_ORDERS_SUCCESS are dispatched\n+await waitForActions(store, expectedActions, (expectedActions, storeActions) => {","path":"README.md","position":49,"original_position":49,"commit_id":"e9e225bce3b18e6037da4c82192e382347fd42a9","original_commit_id":"e9e225bce3b18e6037da4c82192e382347fd42a9","user":{"login":"satazor","id":1017236,"avatar_url":"https://avatars2.githubusercontent.com/u/1017236?v=4","gravatar_id":"","url":"https://api.github.com/users/satazor","html_url":"https://github.com/satazor","followers_url":"https://api.github.com/users/satazor/followers","following_url":"https://api.github.com/users/satazor/following{/other_user}","gists_url":"https://api.github.com/users/satazor/gists{/gist_id}","starred_url":"https://api.github.com/users/satazor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satazor/subscriptions","organizations_url":"https://api.github.com/users/satazor/orgs","repos_url":"https://api.github.com/users/satazor/repos","events_url":"https://api.github.com/users/satazor/events{/privacy}","received_events_url":"https://api.github.com/users/satazor/received_events","type":"User","site_admin":false},"body":"Isn't the third argument, an options object with a `matcher`?","created_at":"2018-02-01T00:17:23Z","updated_at":"2018-02-01T00:34:10Z","html_url":"https://github.com/moxystudio/redux-mock-store-await-actions/pull/20#discussion_r165227962","pull_request_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/20","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/comments/165227962"},"html":{"href":"https://github.com/moxystudio/redux-mock-store-await-actions/pull/20#discussion_r165227962"},"pull_request":{"href":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/20","id":164025708,"html_url":"https://github.com/moxystudio/redux-mock-store-await-actions/pull/20","diff_url":"https://github.com/moxystudio/redux-mock-store-await-actions/pull/20.diff","patch_url":"https://github.com/moxystudio/redux-mock-store-await-actions/pull/20.patch","issue_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/issues/20","number":20,"state":"open","locked":false,"title":"Add option to honor the order of expected actions","user":{"login":"acostalima","id":2727522,"avatar_url":"https://avatars0.githubusercontent.com/u/2727522?v=4","gravatar_id":"","url":"https://api.github.com/users/acostalima","html_url":"https://github.com/acostalima","followers_url":"https://api.github.com/users/acostalima/followers","following_url":"https://api.github.com/users/acostalima/following{/other_user}","gists_url":"https://api.github.com/users/acostalima/gists{/gist_id}","starred_url":"https://api.github.com/users/acostalima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acostalima/subscriptions","organizations_url":"https://api.github.com/users/acostalima/orgs","repos_url":"https://api.github.com/users/acostalima/repos","events_url":"https://api.github.com/users/acostalima/events{/privacy}","received_events_url":"https://api.github.com/users/acostalima/received_events","type":"User","site_admin":false},"body":"BREAKING CHANGE: convert timeout argument to an options object\r\n\r\nResolves #6 ","created_at":"2018-01-19T17:28:17Z","updated_at":"2018-02-01T00:34:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5649770c54fd30b94ed4879a10f77aee753bbef3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/20/commits","review_comments_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/20/comments","review_comment_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/issues/20/comments","statuses_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/statuses/e9e225bce3b18e6037da4c82192e382347fd42a9","head":{"label":"acostalima:honor-expected-actions-order","ref":"honor-expected-actions-order","sha":"e9e225bce3b18e6037da4c82192e382347fd42a9","user":{"login":"acostalima","id":2727522,"avatar_url":"https://avatars0.githubusercontent.com/u/2727522?v=4","gravatar_id":"","url":"https://api.github.com/users/acostalima","html_url":"https://github.com/acostalima","followers_url":"https://api.github.com/users/acostalima/followers","following_url":"https://api.github.com/users/acostalima/following{/other_user}","gists_url":"https://api.github.com/users/acostalima/gists{/gist_id}","starred_url":"https://api.github.com/users/acostalima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acostalima/subscriptions","organizations_url":"https://api.github.com/users/acostalima/orgs","repos_url":"https://api.github.com/users/acostalima/repos","events_url":"https://api.github.com/users/acostalima/events{/privacy}","received_events_url":"https://api.github.com/users/acostalima/received_events","type":"User","site_admin":false},"repo":{"id":118155316,"name":"redux-mock-store-await-actions","full_name":"acostalima/redux-mock-store-await-actions","owner":{"login":"acostalima","id":2727522,"avatar_url":"https://avatars0.githubusercontent.com/u/2727522?v=4","gravatar_id":"","url":"https://api.github.com/users/acostalima","html_url":"https://github.com/acostalima","followers_url":"https://api.github.com/users/acostalima/followers","following_url":"https://api.github.com/users/acostalima/following{/other_user}","gists_url":"https://api.github.com/users/acostalima/gists{/gist_id}","starred_url":"https://api.github.com/users/acostalima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acostalima/subscriptions","organizations_url":"https://api.github.com/users/acostalima/orgs","repos_url":"https://api.github.com/users/acostalima/repos","events_url":"https://api.github.com/users/acostalima/events{/privacy}","received_events_url":"https://api.github.com/users/acostalima/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/acostalima/redux-mock-store-await-actions","description":"Waits for specific actions to be dispatched or a timeout expires","fork":true,"url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions","forks_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/forks","keys_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/teams","hooks_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/hooks","issue_events_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/issues/events{/number}","events_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/events","assignees_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/assignees{/user}","branches_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/branches{/branch}","tags_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/tags","blobs_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/git/refs{/sha}","trees_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/statuses/{sha}","languages_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/languages","stargazers_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/stargazers","contributors_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/contributors","subscribers_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/subscribers","subscription_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/subscription","commits_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/commits{/sha}","git_commits_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/git/commits{/sha}","comments_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/comments{/number}","issue_comment_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/issues/comments{/number}","contents_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/contents/{+path}","compare_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/merges","archive_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/downloads","issues_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/issues{/number}","pulls_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/pulls{/number}","milestones_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/milestones{/number}","notifications_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/labels{/name}","releases_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/releases{/id}","deployments_url":"https://api.github.com/repos/acostalima/redux-mock-store-await-actions/deployments","created_at":"2018-01-19T17:19:02Z","updated_at":"2018-01-19T17:19:04Z","pushed_at":"2018-01-31T14:21:51Z","git_url":"git://github.com/acostalima/redux-mock-store-await-actions.git","ssh_url":"git@github.com:acostalima/redux-mock-store-await-actions.git","clone_url":"https://github.com/acostalima/redux-mock-store-await-actions.git","svn_url":"https://github.com/acostalima/redux-mock-store-await-actions","homepage":"","size":96,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"moxystudio:master","ref":"master","sha":"14830778fbbda5e4655c051c0966d9f2fb940eea","user":{"login":"moxystudio","id":19508739,"avatar_url":"https://avatars2.githubusercontent.com/u/19508739?v=4","gravatar_id":"","url":"https://api.github.com/users/moxystudio","html_url":"https://github.com/moxystudio","followers_url":"https://api.github.com/users/moxystudio/followers","following_url":"https://api.github.com/users/moxystudio/following{/other_user}","gists_url":"https://api.github.com/users/moxystudio/gists{/gist_id}","starred_url":"https://api.github.com/users/moxystudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moxystudio/subscriptions","organizations_url":"https://api.github.com/users/moxystudio/orgs","repos_url":"https://api.github.com/users/moxystudio/repos","events_url":"https://api.github.com/users/moxystudio/events{/privacy}","received_events_url":"https://api.github.com/users/moxystudio/received_events","type":"Organization","site_admin":false},"repo":{"id":106695413,"name":"redux-mock-store-await-actions","full_name":"moxystudio/redux-mock-store-await-actions","owner":{"login":"moxystudio","id":19508739,"avatar_url":"https://avatars2.githubusercontent.com/u/19508739?v=4","gravatar_id":"","url":"https://api.github.com/users/moxystudio","html_url":"https://github.com/moxystudio","followers_url":"https://api.github.com/users/moxystudio/followers","following_url":"https://api.github.com/users/moxystudio/following{/other_user}","gists_url":"https://api.github.com/users/moxystudio/gists{/gist_id}","starred_url":"https://api.github.com/users/moxystudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moxystudio/subscriptions","organizations_url":"https://api.github.com/users/moxystudio/orgs","repos_url":"https://api.github.com/users/moxystudio/repos","events_url":"https://api.github.com/users/moxystudio/events{/privacy}","received_events_url":"https://api.github.com/users/moxystudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moxystudio/redux-mock-store-await-actions","description":"Waits for specific actions to be dispatched or a timeout expires","fork":false,"url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions","forks_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/forks","keys_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/teams","hooks_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/hooks","issue_events_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/issues/events{/number}","events_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/events","assignees_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/assignees{/user}","branches_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/branches{/branch}","tags_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/tags","blobs_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/git/refs{/sha}","trees_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/statuses/{sha}","languages_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/languages","stargazers_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/stargazers","contributors_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/contributors","subscribers_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/subscribers","subscription_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/subscription","commits_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/commits{/sha}","git_commits_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/git/commits{/sha}","comments_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/comments{/number}","issue_comment_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/issues/comments{/number}","contents_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/contents/{+path}","compare_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/merges","archive_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/downloads","issues_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/issues{/number}","pulls_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls{/number}","milestones_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/milestones{/number}","notifications_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/labels{/name}","releases_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/releases{/id}","deployments_url":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/deployments","created_at":"2017-10-12T13:18:45Z","updated_at":"2018-01-20T03:33:13Z","pushed_at":"2018-01-31T14:21:53Z","git_url":"git://github.com/moxystudio/redux-mock-store-await-actions.git","ssh_url":"git@github.com:moxystudio/redux-mock-store-await-actions.git","clone_url":"https://github.com/moxystudio/redux-mock-store-await-actions.git","svn_url":"https://github.com/moxystudio/redux-mock-store-await-actions","homepage":"","size":91,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":2,"open_issues":3,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/20"},"html":{"href":"https://github.com/moxystudio/redux-mock-store-await-actions/pull/20"},"issue":{"href":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/issues/20"},"comments":{"href":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/moxystudio/redux-mock-store-await-actions/statuses/e9e225bce3b18e6037da4c82192e382347fd42a9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"satazor"}}