Re:A generically typed pipe function in TypeScript
by AprilArcus on Monday August 08, 2022 @02:09AM
(#32382794)
I think `Object.prototype.then` would break every source file that uses `typeof o?.then === 'function'` as a check for PromiseLike behavior.
- the preargs thing presumably doesn’t work for promises so you’d need to use bind.
- there’s no great way to specify ‘the function which is property foo of the object being operated on’ to e.g. map an array that is in a promise you can’t write .then(.map, …). But I think this is also a problem with other pipe implementations.