Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ActionFunction<D, S, R>

interface

ActionFunction

description

A Function invoked per iteration

example

const source = {
  foo: {
    bar: 'bar'
  }
};
let schema = {
  bar: iteratee => {
    // Apply a function over the source propery
    return iteratee.foo.bar;
  }
};

morphism(schema, source);
//=> { bar: 'bar' }

Type parameters

  • D

    Destination / Target type

  • S

    Source / Input type

  • R

    Inferred result type

Hierarchy

  • ActionFunction

Callable

  • __call(iteratee: S, source: S[], target: D): R
  • Parameters

    • iteratee: S

      The current element to transform

    • source: S[]

      The source input to transform

    • target: D

      The current element transformed

    Returns R

Generated using TypeDoc