Skip to content

Instantly share code, notes, and snippets.

Last active Aug 17, 2018
What would you like to do?
function toResponseActions(successSelector, errorSelector){
return (requests$) => requests$.pipe(
catchError(err, => errorSelector(err)),
map(res => successSelector(res))
const buttonClicks = fromEvent('button', 'click');
const requests = buttonClicks.pipe(switchMap(() => http.get('foo.json')));
const responses = requests.pipe(
res => ({type: 'SUCCESS', payload: })),
err => ({type: 'ERROR', payload: error }))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment