다음 코드 포인트를 무료로 만들 수있는 방법에 대해 머리를 감쌀 수 없습니다. 다음은 작동하지만 불필요한 중간 상태 변수가 필요합니다.파이프 내부에 포인트가없는 부분 적용?
import { pipe, curryN, __, prop } from 'Ramda'
import ns from 'ns'
// For the sake of this, let's say `ns.foo` is just `console.log`
// (it can take any number of args)
const bar = pipe(
prop('foo'),
curryN(3),
(x) => x(__, 'b', __),
Promise.promisify, // or something
)(ns)
bar('a', 'c')
// => 'a b c'
Here's a contrived version on the Ramda repl.
코드에 * state * 변수가 표시되지 않습니까? – Bergi
'(x) => x (__, 'b', __), 익명 함수'x'는'curryN (3)'이 제거하려고하는 것 이후입니다. – rjhilgefort