Some times we are just awaiting a function, so we don't really care if the returned value is actually a promise or not. With Promisable
:
type Promisable<T> = T | Promise<T>;
One could write this:
type Foo = () => Promisable<string | number | null>
Rather than:
type Foo = () => string | number | null | Promise<string> | Promise<number> | Promise<null>
It helps write a bit cleaner code. I'm not sure if it's useful enough to be included here, but I thought I'd mention it.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too