Skip to content

Instantly share code, notes, and snippets.

@szmeku
Last active April 28, 2020 18:12
Show Gist options
  • Select an option

  • Save szmeku/20e723d0e287790100a556a9788987fa to your computer and use it in GitHub Desktop.

Select an option

Save szmeku/20e723d0e287790100a556a9788987fa to your computer and use it in GitHub Desktop.
// before
const filterPlatesToCombine = () => keys(
pickBy((val, key) => val.combine === true && isEmpty(val.harvestBarcode), barcodeCombinations))
.map(val => { return {id: `plate-barcode-to-combine-${val}`, name: val} });
// after
const platesWithOptions = [..te kombinacje ktore teraz masz..];
const toSortableItem = v => ({id: `plate-barcode-to-combine-${val}`, name: val});
const barcodesForCombinations = pipe(
pickBy(allPass([
propEq('combine', true),
propSatisfies(isEmpty, 'harvestBarcode')
])),
keys,
);
// someHtml
<ul>
{pipe(
barcodesForCombinations,
map(toSortableItem),
v => <li>jakis html {v}</li>
)(platesWithOptions)}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment