Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.09 KB

File metadata and controls

41 lines (29 loc) · 1.09 KB

DashKite River

Iterator and reactor functions for JavaScript

Hippocratic License HL3-CORE

River provides a unified functional interface for iterators and reactors (asynchronous iterators). Every function is curried and automatically dispatches to the most efficient implementation based on the input type.

Use

import { pipe } from "@dashkite/joy/function"
import {
  collect
  map
  resolve
} from "@dashkite/river"

json = ( response ) -> response.json()

get = pipe [
  map fetch
  resolve
  map json
  resolve
  collect
]

values = await get [ "https://httpbin.org/json" ]

Features

  • Uses lazy evaluation whenever possible
  • Dispatches to the optimized implementation based on the arguments
  • Provides a functional interface for a superset of the JavaScript iterator helpers
  • Preserves this binding within combinators allowing use within methods

API Reference

API Reference