I hereby claim:
- I am pyrolistical on github.
- I am pyrolistical (https://keybase.io/pyrolistical) on keybase.
- I have a public key ASDiQZcpChgkowEteTMFVfQedMaG6l_I3Nqz9G_C5ctSGAo
To claim this, I am signing this object:
| // BEFORE | |
| const [costlyValue, setCostlyValue] = setState(); | |
| useEffect(() => { | |
| setCostlyValue(computedCostlyValue(props.someParam)); | |
| }, [props.someParam]); | |
| // AFTER | |
| const costlyValue = useMemo(() => computedCostlyValue(props.someParam), [props.someParam]); |
| // BEFORE | |
| const [state, setState] = useState(); | |
| useEffect(() => { | |
| setState(calculateInitialState()); | |
| }, []); | |
| // AFTER | |
| const [state, setState] = useState(calculateInitialState); |
| type ApexLegendsGameResult = { | |
| teamID: string, | |
| placement: number, | |
| kills: number | |
| }; | |
| application.post('/apex-legends/:gameID/report-score', async ({params: {gameID}, body}, res) => { | |
| await db.collection('apexLegendsGames').updateOne({ | |
| _id: gameID | |
| }, { | |
| $set: { |
| type ApexLegendsGameResult = { | |
| teamID: string, | |
| placement: number, | |
| kills: number | |
| }; | |
| application.post('/apex-legends/:gameID/report-score', async ({params: {gameID}, body}, res) => { | |
| const results: ApexLegendsGameResult[] = body; | |
| await db.collection('apexLegendsGames').updateOne({ | |
| _id: gameID | |
| }, { |
| type ApexLegendsGameResult = { | |
| teamID: string, | |
| placement: number, | |
| kills: number | |
| }; | |
| application.post('/apex-legends/:gameID/report-score', async ({params: {gameID}, body}, res) => { | |
| await db.collection('apexLegendsGames').updateOne({ | |
| _id: gameID | |
| }, { |
| try { | |
| const audioDataCount = await axios.post(netlifyConfig().DOMAIN + 'get-scene-audio-count', { | |
| email: value.email, | |
| sourceID: value.sourceID, | |
| source: value.source | |
| }) | |
| console.log('audioDataCount', audioDataCount) | |
| const res = { | |
| count: audioDataCount.data.audioScenesList.count, | |
| data: audioDataCount.data.audioScenesList.items |
| const doABRegister = function( connectAPI, { appGuid, serialNumber, email }, data, logger ) { | |
| const deviceIdPromise = doABRegisterDevice( connectAPI, appGuid, serialNumber ); | |
| const accountIdPromise = deviceIdPromise | |
| .then( deviceId => doABCreateAccount( connectAPI, appGuid, deviceId, email, data ); | |
| const vhIdPromise = Promise.all([deviceIdPromise, accountIdPromise]) | |
| .then( ([deviceId, accountId]) => doABFetchVh( connectAPI, { appGuid, deviceId, accountId }, data, logger ); | |
| return Promise.all([deviceIdPromise, accountIdPromise, vhIdPromise]) | |
| .then( ([deviceId, accountId, vhId]) => ( { deviceId, accountId, vhId } ); | |
| }; |
| The pattern you showed at ployglotconf: | |
| import a from './a' | |
| import b from './b' | |
| import c from './c' | |
| export const xyz = (a, b, c) => { | |
| return { | |
| method() { | |
| ...use deps a, b, c |
I hereby claim:
To claim this, I am signing this object:
| module.exports = (lolClient) => { | |
| return { | |
| method: 'GET', | |
| path: '/v1/lol/summoner/getByName/{summonerName}', | |
| handler({query: {region}, params: {summonerName}}, reply) { | |
| return lolClient.Summoner.gettingByName(summonerName) | |
| .then((summoner) => { | |
| if (!summoner) { | |
| return reply(Boom.notFound(`Summoner was not found | |
| ${summonerName} not found`)); |