/path/to/feature
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
import FeatureProvider from '../providers/feature-provider'; | |
import EnvProvider from '../providers/env-provider'; | |
import LoaderProvider from '../providers/loader-provider'; | |
import CouponProvider from '../providers/coupon-provider'; | |
import LayoutProvider from '../providers/layout-provider'; | |
import AuthProvider from '../providers/auth-provider'; | |
import RouterProvider from '../providers/RouterProvider'; | |
import MagicLinkProvider from '../providers/magic-link-provider'; | |
import PageComponent from './page-container'; |
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
import { compose } from 'lodash/fp'; | |
import withFeatures from './with-features'; | |
import withEnv from './with-env'; | |
import withLoader from './with-loader'; | |
import withCoupon from './with-coupon'; | |
import withLayout from './with-layout'; | |
import withAuth from './with-auth'; | |
import { withRouter } from 'next/router'; | |
import withMagicLink from '../features/ethereum-authentication/with-magic-link'; |
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 ItemList = ({ items }) => ( | |
<ul> | |
{items.map((item) => ( | |
<li key={item.id}> | |
<div>{item.name}</div> | |
</li> | |
))} | |
</ul> | |
); |
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 doubleList = list => list.map(x => x * 2); |
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 doubleList = list => { | |
const newList = []; | |
for (var i = 0; i < list.length; i++) { | |
newList[i] = list[i] * 2; | |
} | |
return newList; | |
}; |
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
import produce from 'immer'; | |
const like = item => ({ | |
type: like.type, | |
payload: item | |
}); | |
like.type = 'user/like'; | |
const initialState = { | |
name: 'Anonymous', |
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 like = item => ({ | |
type: like.type, | |
payload: item | |
}); | |
like.type = 'user/like'; | |
const initialState = { | |
name: 'Anonymous', | |
avatar: 'Anonymous', | |
email: '', |
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 compose = (...fns) => x => fns.reduceRight((y, f) => f(y), x); | |
function map(f) { | |
return async function*(values) { | |
for await (const x of values) { | |
yield f(x); | |
} | |
}; | |
} |
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
// setup | |
const wait = value => new Promise(resolve => { | |
setTimeout(() => resolve(value), 3000); | |
}); | |
const fetchFoo = () => wait('foo'); | |
const fetchBar = () => wait('bar'); | |
const fetchBaz = () => wait('baz'); | |
const fetchDataSlowly = async time => { |
NewerOlder