Skip to content

Instantly share code, notes, and snippets.

View littlemooon's full-sized avatar
🌙

fred wright littlemooon

🌙
View GitHub Profile

Keybase proof

I hereby claim:

  • I am littlemooon on github.
  • I am littlemooon (https://keybase.io/littlemooon) on keybase.
  • I have a public key whose fingerprint is 6B7E 03B7 C737 1BE5 CA8D 6FBD EDEC FAFF E082 E9D2

To claim this, I am signing this object:

@littlemooon
littlemooon / CountryState.tsx
Created November 24, 2018 09:55
Country context state component
import to from 'await-to-js';
import countries from 'common/config/world-countries.js';
import { waitUntilResolved } from 'common/lib/fetch-helpers';
import { formatOperatorResponse } from 'common/lib/operator';
import {
getStorageItem,
removeStorageItem,
setStorageItem,
StorageKey,
} from 'common/lib/storage';
import memoize from 'memoizee'
export default function makeCallback() {
return memoize(
function(func, args) {
return function(additionalArgs) {
return func(...args, ...additionalArgs)
}
},
{ length: false }
@littlemooon
littlemooon / react-lifecycle-methods.md
Last active March 1, 2018 05:52
Handy guide to react lifecycle methods

react lifecycle methods

constructor

DO

  • set initial state
  • if not using class properties syntax — prepare all class fields and bind functions that will be passed as callbacks

DON’T

  • cause any side effects (AJAX calls etc.)