Skip to content

dmail-old/thenable

Repository files navigation

Thenable

npm build codecov

Minimalist promise helpers

Example

import { sequenceFunctions } from "@dmail/thenable"

const promise = sequenceFunctions(
	() => Promise.resolve(10),
	(value) => Promise.resolve(value + 2),
	(value) => value / 2,
)

promise.then((value) => {
	console.log(value) // logs 6
})

Check the API documentation