Open
Description
Hi,
an operator only consisting of a pipe like the following:
export const positiveFeedback = pipe(() => Promise.resolve({ success: true }));
has for some reason NOT a type like: () => Promise<{success: true}>
, but INSTEAD following type: () => Promise<Promise<{success: true}>>
which isn't really possible.
I created a minimal example in codesandbox demonstrating the problem.
In src/App/App.tsx you can find the following:
const fails: () => Promise<{ success: boolean }> =
actions.demo.positiveFeedback;
const works: () => Promise<Promise<{ success: boolean }>> =
actions.demo.positiveFeedback;
const workaround: () => Promise<{ success: boolean }> = async () =>
await actions.demo.positiveFeedback();
Metadata
Metadata
Assignees
Labels
No labels