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
console.clear() | |
// util.js | |
///////////////////////////////////////////////////////////////// | |
const PromiseResolve = x => Promise.resolve(x) | |
// pipeAny.js | |
///////////////////////////////////////////////////////////////// | |
const pipeAny = compose( | |
apply(pipeP), |
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 evolveAll = spec => compose( | |
evolve(spec), | |
compose(pickAll, keys)(spec), | |
) | |
const maybeHof = compose(when, complement)(isNil) | |
const maybeToUpper = maybeHof(toUpper) | |
evolveAll({ |
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 maybeHof = compose(when, complement)(isNil) | |
const maybeToUpper = maybeHof(toUpper) | |
maybeToUpper(null) // null | |
maybeToUpper(undefined) // undefined | |
maybeToUpper('foo') // 'FOO' |
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 { log, clear } = console | |
clear() | |
class Foo { | |
constructor() { | |
this.state = {} | |
this.util = { | |
nested: { | |
mergeRight, | |
identity, |
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 { log, clear } = console; | |
clear(); | |
log('================================================='); | |
const add2 = (x, y) => x + y; | |
const add2P = (x, y) => Promise.resolve(x + y); | |
const logFn = | |
const logAdd2 = logFn(add2); |
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
console.clear() | |
const upperAsync = (x) => Promise.resolve(toUpper(x)) | |
const splitChars = split('') | |
const handleResponse = curry((tag, promise) => | |
pipe( | |
then((data) => { | |
console.log(`${tag}-SUCCESS: ${data}`) | |
return data |
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
#!/usr/bin/env node | |
/* eslint-disable import/no-commonjs */ | |
;(async () => { | |
const util = require('util') | |
const child_process = require('child_process') | |
const { tap } = require('ramda') | |
const execP = util.promisify(child_process.exec) | |
const exec = command => execP(command).then(({ stdout, stderr }) => {}) |
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 { log, clear } = console | |
clear() | |
const logHof = (fn) => (...args) => pipe( | |
tap(() => log('-----------------------------')), | |
tap((args) => log(`args: ${args}`)), | |
fn, | |
tap((res) => log(`res: ${res}`)), | |
)(...args) |
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 fs = require('fs') | |
const path = require('path') | |
const _ = require('lodash') | |
const parser = require('csv-parse/lib/sync') | |
const JsonStringify = x => JSON.stringify(x, null, 2) | |
const SRC_DIR = path.join(__dirname, '..', 'src') | |
_.forEach( |
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 { curry } from 'lodash/fp' | |
import PropTypes, { func, shape } from 'prop-types' | |
const args = { | |
openEntity: func.isRequired, | |
closeEntity: func.isRequired, | |
gridApi: shape({ | |
getDisplayedRowCount: func.isRequired, | |
isQuickFilterPresent: func.isRequired, | |
}).isRequired, |