P.coroutine and _.curry issue
✓ Published0🌍 Public
RRestuta
Last edited May 18, 2017
Created on May 18, 2017
This example shows a failed integration between Bluebird's `P.coroutine` and Lodash's `_.curry` in an asynchronous function composition. The code defines `asyncSum` and `asyncSquare` as Promise-returning functions and attempts to curry a generator-based `asyncSumAndSquare` with `_.curry`. While manual currying works, `P.coroutine` returns a function accepting only one argument, so the curried call `parialAsyncSumAndSquare(2)(2)` fails, whereas a vanilla curried function using `_.curry` succeeds. The animation rendering and use of `setInterval` for promise resolution are visible.
AI-generated description