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
import { get } from 'lodash' | |
import { createEventHandler } from 'recompose' | |
const selectUser = mapPropsStream(props$ => { | |
const { stream: selected$, handler: userSelect } = createEventHandler() | |
return props$.pipe( | |
switchMap(props => { | |
const userInURL = get(props, 'match.params.user') | |
return selected$ | |
.pipe( |
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 load = mapPropsStream(props$ => | |
props$.pipe( | |
switchMap(props => | |
from(fetchUsers()).pipe( | |
tap(res => console.log('response from fetchUsers', res), | |
map(users => ({ ...props, users, status: 'SUCCESS' })), | |
startWith({ status: 'REQUEST' }) | |
) | |
), | |
catchError(() => ({ status: 'ERROR', message: 'Looks like our service is down' })) |
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
import { from , to } from 'rxjs' | |
import { setObservableConfig, mapPropsStream } from 'recompose' | |
import { isEmpty } from 'lodash' | |
import { switchMap, map, startWith, tap, catchError } from 'rxjs/operators' | |
const load = mapPropsStream(props$ => | |
props$.pipe( | |
switchMap( | |
props => | |
isEmpty(props.userList) |
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
import { setObservableConfig } from 'recompose' | |
import { from, to } from 'rxjs' | |
setObservableConfig({ fromESOBservable: from, toESObservable: to }) |
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
" Don't try to be vi compatible | |
set nocompatible | |
" Helps force plugins to load correctly when it is turned back on below | |
filetype off | |
" TODO: Load plugins here (pathogen or vundle) | |
" Turn on syntax highlighting | |
syntax on |
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
;;; init.el -*- lexical-binding: t; -*- | |
;; Copy me to ~/.doom.d/init.el or ~/.config/doom/init.el, then edit me! | |
(doom! :feature | |
(popup ; tame sudden yet inevitable temporary windows | |
+all ; catch all popups that start with an asterix | |
+defaults) ; default popup rules | |
;debugger ; FIXME stepping through code, to help you add bugs | |
eval ; run code, run (also, repls) | |
(evil +everywhere); come to the dark side, we have cookies |
NewerOlder