{"action":"created","issue":{"url":"https://api.github.com/repos/ngxs/store/issues/166","repository_url":"https://api.github.com/repos/ngxs/store","labels_url":"https://api.github.com/repos/ngxs/store/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/ngxs/store/issues/166/comments","events_url":"https://api.github.com/repos/ngxs/store/issues/166/events","html_url":"https://github.com/ngxs/store/issues/166","id":308588445,"number":166,"title":"Multiple calls HTTP in one action","user":{"login":"mailok","id":3769277,"avatar_url":"https://avatars3.githubusercontent.com/u/3769277?v=4","gravatar_id":"","url":"https://api.github.com/users/mailok","html_url":"https://github.com/mailok","followers_url":"https://api.github.com/users/mailok/followers","following_url":"https://api.github.com/users/mailok/following{/other_user}","gists_url":"https://api.github.com/users/mailok/gists{/gist_id}","starred_url":"https://api.github.com/users/mailok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mailok/subscriptions","organizations_url":"https://api.github.com/users/mailok/orgs","repos_url":"https://api.github.com/users/mailok/repos","events_url":"https://api.github.com/users/mailok/events{/privacy}","received_events_url":"https://api.github.com/users/mailok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":21,"created_at":"2018-03-26T14:09:19Z","updated_at":"2018-03-26T19:44:12Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nWe will close this issue if you don't provide the needed information.\r\nFor feature requests, delete the form below and describe the requirements and use case.\r\n-->\r\n\r\n### Versions\r\n\r\n<!--\r\nPlease provide ther version of NGXS that you are using as well as the version of Angular\r\n-->\r\n\r\n```\r\n* ngxs: 2.0.0-rc.21\r\n* @angular/core: 5.2.9\r\n```\r\n\r\nWhen I define an acynchronous action, multiple calls are made.\r\n\r\n```\r\n@Action(SearchPeoples)\r\n  serarchPeoples({ getState, setState }: StateContext<ParkStateModel>) {\r\n    const state = getState();\r\n    return this.http.get<Search>('https://randomuser.me/api/?results=5').pipe(\r\n      tap(value => {\r\n        console.log('updating the state...');\r\n        setState({\r\n          ...state,\r\n          search: value.results\r\n        });\r\n        console.log('status updated.');\r\n      })\r\n    );\r\n  }\r\n\r\n```\r\n\r\n```\r\nsearch() {\r\n    this.store.dispatch(new SearchPeoples()).subscribe(value => {\r\n      console.log('The action is completed.');\r\n    });\r\n  }\r\n\r\n```\r\n\r\nWhen I dispach the action:\r\n\r\n![a](https://user-images.githubusercontent.com/3769277/37911026-f9a704f4-30dc-11e8-8bf1-f366911acb31.PNG)\r\n\r\n\r\n![b](https://user-images.githubusercontent.com/3769277/37911032-ff6bb9fc-30dc-11e8-8b6b-fa6b290bca13.PNG)\r\n\r\nTwo calls HTTP are made, when it should have been one.\r\n\r\nI thought it had been solved : fix(core): fix dispatch issue #149 , but it seems that there is still the bug.\r\n\r\nI thought it was no longer necessary to use ``` shareReplay() ``` in my action for solve this.\r\n"},"comment":{"url":"https://api.github.com/repos/ngxs/store/issues/comments/376287975","html_url":"https://github.com/ngxs/store/issues/166#issuecomment-376287975","issue_url":"https://api.github.com/repos/ngxs/store/issues/166","id":376287975,"user":{"login":"mailok","id":3769277,"avatar_url":"https://avatars3.githubusercontent.com/u/3769277?v=4","gravatar_id":"","url":"https://api.github.com/users/mailok","html_url":"https://github.com/mailok","followers_url":"https://api.github.com/users/mailok/followers","following_url":"https://api.github.com/users/mailok/following{/other_user}","gists_url":"https://api.github.com/users/mailok/gists{/gist_id}","starred_url":"https://api.github.com/users/mailok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mailok/subscriptions","organizations_url":"https://api.github.com/users/mailok/orgs","repos_url":"https://api.github.com/users/mailok/repos","events_url":"https://api.github.com/users/mailok/events{/privacy}","received_events_url":"https://api.github.com/users/mailok/received_events","type":"User","site_admin":false},"created_at":"2018-03-26T19:44:11Z","updated_at":"2018-03-26T19:44:11Z","author_association":"NONE","body":"@deebloo hi!, I made an example : https://stackblitz.com/edit/angular-sebheh , but in stackblitz works correctly, so I made a new project in my pc with angular-cli and reproduced the proyect, and behaves with the bug, I really do not know what can be\r\n \r\n"}}
{"actor":{"display_login":"mailok"}}