IF Commons GitHub

logical/layers/layer

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0004-anyfs-middleware FR-001

A layer: a function of a store to a store, written over the handler of operations. A layer says in its type which capabilities it keeps; pipe applies layers in the order given and the type of the result is the type the last layer gives. A layer keeps every capability that has an operation: watch and lock have none to carry, and a layer that wants them says so by making them itself.

pipe has one cast, in its implementation: its overloads are the typed surface, and each step is a layer from the store the step before gave.

import { pipe } from "./layer.ts";
// const guarded = pipe(store, (s) => readOnly(s), (s) => traced(s, tracer))

Source: commons/anyfs/src/logical/layers/layer.ts

1 of 3 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

Layertypeno test imports it
type Layer<In extends Capability, Out extends Capability> = (store: Store<In>) => Store<Out>;

A function of a store to a store.

Nexttypeno test imports it
type Next = (op: Op) => Promise<Result<Done, Problem>>;

What a layer wraps: the handler of the store it is given.

pipefunction
function pipe: { <A extends Capability, B extends Capability>(store: Store<A>, l1: Layer<A, B>): Store<B>; <A extends Ca… (612 characters)
function pipe: { <A extends Capability, B extends Capability>(store: Store<A>, l1: Layer<A, B>): Store<B>; <A extends Capability, B extends Capability, C extends Capability>(store: Store<A>, l1: Layer<A, B>, l2: Layer<B, C>): Store<C>; <A extends Capability, B extends Capability, C extends Capability, D extends Capability>(store: Store<A>, l1: Layer<A, B>, l2: Layer<B, C>, l3: Layer<C, D>): Store<D>; <A extends Capability, B extends Capability, C extends Capability, D extends Capability, E extends Capability>(store: Store<A>, l1: Layer<A, B>, l2: Layer<B, C>, l3: Layer<C, D>, l4: Layer<D, E>): Store<E>; }

A store through one layer. A store through two layers, in the order given. A store through three layers, in the order given. A store through four layers, in the order given. A store through the layers given, in the order given.

Imported by 6 tests of the run (6 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.