Utility library for asynchronous functional programming


Keywords
async, context, dependency, functional, typescript, fp, functional-programming, promise
License
MIT
Install
npm install async-fp@9.0.13

Documentation

async-fp repository

GitHub NodeJS Codecov

async-fp

NPM version NPM downloads Bundle size

A collection of utilities for asynchronous functional programming.

@unional/async-context

NPM version NPM downloads Bundle size

Secure, type safe, asynchronous context for functional programming.

Introduction Video

import { AsyncContext } from '@unional/async-context'

const context = new AsyncContext(async () => ({ config: 'async value' }))

await context.get() //=> { config: 'async value' }

@unional/gizmo

NPM version NPM downloads Bundle size

@unional/gizmo is a library to create gizmo: an object with static or dynamic dependencies, with an optional start function.

import { define, incubate } from '@unional/gizmo'

const gizmo = define({
  async create() { return { foo: { blow() { /* ..snap.. */ } } } }
})

const gizmoWithStart = define({
  async create() {
    return [
      { foo2: { blow() { /* ..snap.. */ } } },
      () => { /* ..snap.. */ }
    ]
  }
})

const gizmoWithAsyncStart = define({
  async create() {
    return  [
      { foo3: { blow() { /* ..snap.. */ } } },
      async () => { /* ..snap.. */ }
    ]
  }
})

const obj = await incubate().with(gizmo).create()
obj.foo.blow()