@naturalcycles/promise-lib
Useful promise functions, inspired by Bluebird, p-map, p-props
Why
-
bluebird
is outdated -
p-props
requires separate@types/p-props
which has issues - Both
p-map
andp-props
doexport default
, which is not IDE-friendly. IDEs don't automatically suggest to import these functions
Features
- First-class Typescript support, typings included and working
- IDE-friendly, IDE automatically suggest to import from proper place
- Bundled as
es2018
, with native async/await, no transpilation - Based (almost copy-pasted) on battle-tested implementations (
p-map
), tests included
API
pMap
pBatch
pFilter
pProps
pDelay
pHang
-
pState
- returns the current state of the Promise, one ofresolved | rejected | pending
. pDefer