Skip to content

Instantly share code, notes, and snippets.

View hendrikswan's full-sized avatar

hendrik swanepoel hendrikswan

View GitHub Profile
function loadDataEpic(action$) {
return action$
.ofType('LOAD_DATA')
.switchMap(({ url }) =>
fetch(url)
.then(response => response.ok ? response.json() : requestFailedAction())
.then(result => result.type === 'REQUEST_FAILED' ? result : requestSuccessAction(result))
.catch(() => requestFailedAction())
)
}
const handleDrawingEvent = line => ({
line,
type: 'LINE_DRAWN'
})
const drawingSyncSuccess = () => ({
type: 'DRAWING_SYNC_SUCCESS',
})
const drawingSyncFailure = () => ({
function (action$: Observable<Action>, store: Store): Observable<Action>;
const handleDrawingEvent = line => ({
line,
type: 'LINE_DRAWN'
})
const defaultState = { lines: [] };
const reducer = (state = defaultState, action) => {
switch (action.type) {
case 'LINE_DRAWN':
function handleDrawingEvent(line) {
return (dispatch, getState) => {
console.log(`From (${line.from.x},${line.from.y}) to (${line.to.x},${line.to.y})`);
}
}
puts "hello"
function subscribeToTimer(interval, cb) {
}
export {
subscribeToTimer,
};
function hello() {
console.log('does this embed correctly in medium?');
}
function subscribeToTimer(interval, cb) {
}
export {
subscribeToTimer,
};
function subscribeToTimer(interval, cb) {
}
export {
subscribeToTimer,
};