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 splitArrayIntoBatches = (arr, limit) => arr.reduce((memo, item) => { | |
if (memo.length && memo[memo.length - 1].length < limit) { | |
memo[memo.length - 1].push(item); | |
return memo; | |
} | |
return [...memo, [item]]; | |
}, []); | |
const pact = (tasks, concurrency, interval = 0, failFast = true) => { |
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 splitArrayIntoBatches = (arr, limit) => arr.reduce((memo, item) => { | |
if (memo.length && memo[memo.length - 1].length < limit) { | |
memo[memo.length - 1].push(item); | |
return memo; | |
} | |
return [...memo, [item]]; | |
}, []); | |
const throttled = (tasks, concurrency, interval = 0) => { |
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 splitArrayIntoBatches = (arr, limit) => arr.reduce((memo, item) => { | |
if (memo.length && memo[memo.length - 1].length < limit) { | |
memo[memo.length - 1].push(item); | |
return memo; | |
} | |
return [...memo, [item]]; | |
}, []); | |
const batched = (tasks, concurrency) => { |
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 splitArrayIntoBatches = (arr, limit) => arr.reduce((memo, item) => { | |
if (memo.length && memo[memo.length - 1].length < limit) { | |
memo[memo.length - 1].push(item); | |
return memo; | |
} | |
return [...memo, [item]]; | |
}, []); |
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 React from 'react'; | |
import Profile from './Profile'; | |
export default () => ( | |
<div> | |
<Profile user={{ name: 'Jimi Hendrix', email: '[email protected]' }} /> | |
</div> | |
); |
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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
const Profile = ({ user = {} }) => ( | |
<div> | |
<h2>{user.name}</h2> | |
<p> | |
<a href={`mailto:${user.email}`}> | |
{user.email} | |
</a> |
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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
const Profile = ({ user = {} }) => ( | |
<div> | |
<h2>{user.name}</h2> | |
<p> | |
<a href={`mailto:${user.email}`}> | |
{user.email} | |
</a> |
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 React from 'react'; | |
export default ({ user = {} }) => ( | |
<div> | |
<h2>{user.name}</h2> | |
<p> | |
<a href={`mailto:${user.email}`}> | |
{user.email} | |
</a> | |
</p> |
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
<Profile user={{ name: 'Jimi Hendrix', email: '[email protected]' }} /> |
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 React from 'react'; | |
export default props => ( | |
<div> | |
<h2>{props.user.name}</h2> | |
<p> | |
<a href={`mailto:${props.user.email}`}> | |
{props.user.email} | |
</a> | |
</p> |