Layertypeno test imports ittype Layer<In extends Capability, Out extends Capability> = (store: Store<In>) => Store<Out>;A function of a store to a store.
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))Layertypeno test imports ittype Layer<In extends Capability, Out extends Capability> = (store: Store<In>) => Store<Out>;A function of a store to a store.
Nexttypeno test imports ittype Next = (op: Op) => Promise<Result<Done, Problem>>;What a layer wraps: the handler of the store it is given.
pipefunctionfunction 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.