This file contains 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
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()) | |
) | |
} |
This file contains 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 handleDrawingEvent = line => ({ | |
line, | |
type: 'LINE_DRAWN' | |
}) | |
const drawingSyncSuccess = () => ({ | |
type: 'DRAWING_SYNC_SUCCESS', | |
}) | |
const drawingSyncFailure = () => ({ |
This file contains 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
function (action$: Observable<Action>, store: Store): Observable<Action>; |
This file contains 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 handleDrawingEvent = line => ({ | |
line, | |
type: 'LINE_DRAWN' | |
}) | |
const defaultState = { lines: [] }; | |
const reducer = (state = defaultState, action) => { | |
switch (action.type) { | |
case 'LINE_DRAWN': |
This file contains 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
function handleDrawingEvent(line) { | |
return (dispatch, getState) => { | |
console.log(`From (${line.from.x},${line.from.y}) to (${line.to.x},${line.to.y})`); | |
} | |
} |
This file contains 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
puts "hello" |
This file contains 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
function subscribeToTimer(interval, cb) { | |
} | |
export { | |
subscribeToTimer, | |
}; |
This file contains 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
function hello() { | |
console.log('does this embed correctly in medium?'); | |
} |
This file contains 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
function subscribeToTimer(interval, cb) { | |
} | |
export { | |
subscribeToTimer, | |
}; |
This file contains 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
function subscribeToTimer(interval, cb) { | |
} | |
export { | |
subscribeToTimer, | |
}; |