Last active
March 13, 2018 03:31
-
-
Save cartant/3acfee8bf0c0f9cc0e5e40e14b02f606 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const findAddresses = actions$ => actions$.pipe( | |
| ofType(actions.FIND_ADDRESSES), | |
| map(action => action.partialAddress), | |
| debounceTime(400), | |
| distinctUntilChanged(), | |
| switchMap(partialAddress => this.backend | |
| .findAddresses(partialAddress) | |
| .pipe( | |
| map(results => actions.findAddressesFulfilled(results)), | |
| catchError(error => of(actions.findAddressesRejected(error))) | |
| ) | |
| ) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment