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 { Request, rewireRequest } from "./Request"; | |
const mockRequest = { fake: true }; | |
rewireRequest(mockRequest); | |
// Use mocked request here |
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
rename "s/\.js/\.ts/" **/*.js && git add **/*.ts && git rm **/*.js |
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 dep1 from '../dep1'; | |
import dep2 from '../dep2'; | |
const defaultDeps = { | |
dep1, | |
dep2, | |
}; | |
export function _myModuleFactory({ dep1, dep2 } = defaultDeps) { | |
const myModule = {}; |
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 { Map, List } from 'immutable'; | |
export default function getPhrasesByBlock(phrases) { | |
return phrases.reduce( | |
(phrasesByBlock, phrase) => phrasesByBlock.update( | |
phrase.get(`blockKey`), | |
new List(), | |
(blockPhrases) => blockPhrases.push(phrase) | |
), | |
new Map(), |
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 handlers = new Map({ | |
handlePhraseMouseEnter(phrase) { | |
hoverState.handleMouseEnter(phrase); | |
phraseConfig.handleMouseEnter(phrase); | |
}, | |
handlePhraseMouseLeave(phrase) { | |
hoverState.handleMouseLeave(phrase); | |
phraseConfig.handleMouseLeave(phrase); | |
}, | |
handlePhraseClick: phraseConfig.handlePhraseClick, |
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 pipeline = (...funcs) => | |
value => funcs.reduce((a, b) => b(a), value); |