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 createClientXY(x, y) { | |
return { clientX: x, clientY: y }; | |
} | |
export function createStartTouchEventObject({ x = 0, y = 0 }) { | |
return { touches: [createClientXY(x, y)] }; | |
} | |
export function createMoveTouchEventObject({ x = 0, y = 0}) { | |
return { changedTouches: [createClientXY(x, 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
/* | |
* # 1 | |
* HOC for retrieving and setting a featureFlag prop | |
*/ | |
const withFlag = (name) => compose( | |
connect((state) => { | |
const value = featureFlagSelector(state, { featureFlag }); | |
return { featureFlag, featureFlagValue }; |
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
/* | |
* "restify": "^7.2.0", | |
* "http-proxy": "^1.17.0", | |
* | |
* The restify server will proxy requests that match keys in a `proxies` config. | |
* | |
*/ | |
const restify = require('restify'); | |
const httpProxy = require('http-proxy'); |
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
/* | |
* Component for displaying an experiment and bucket(s) | |
*/ | |
/******************************* | |
* Option 1a - prop renders based on bucket names, ~ mimics <Flag /> | |
*/ | |
<Experiment | |
name="exp:test-message" | |
bucketA={({ recordInteraction }) => (<Message color="blue" onClick={() => recordInteraction('click')}>Welcome!</Message>)} |
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 MAX_BATCH_SIZE = 10; | |
const WAIT_TIME_MS = 1000; | |
const makeRequest = async (id) => { | |
try { | |
await fetch(`/api/${id}`) | |
} catch(error) { } | |
} | |
const batchesOfIds = _.chunk(Ids, MAX_BATCH_SIZE); |
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 interestSurcharge = new Set(['AL']); | |
const flagshipOriginationFee = new Set(['AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', | |
'ID', 'IA', 'KS', 'KY', 'LA', 'ME', 'MS', 'MO', 'NM', 'ND', 'OH', 'OR', | |
'RI', 'SC', 'SD', 'UT', 'VA', 'WV', 'WI', 'WY']); | |
const documentPreparation = new Set(['IL']); | |
const nonrefundablePrepaidFinanceCharge = new Set(['IN']); | |
const notApplicable = new Set(['MD', 'MA', 'MN', 'MT', 'NV', 'NH', 'NJ', 'NY', 'NC', 'PA', 'VT']); | |
| |
const feeNameMap = new Map([ |
OlderNewer