Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface NodeInputSpec

Specification for a single input, which can be given in different ways:

  1. Create a stream for given path in state atom (passed to initGraph):
{ path: "nested.src.path" }
{ path: ["nested", "src", "path"] }
  1. Reference path to another node's output in the GraphSpec object. See {@link @thi.ng/resolve-map# | @thi.ng/resolve-map} for details.
{ stream: "/node-id/node" } // main node output
{ stream: "/node-id/outs/foo" } // specific output
  1. Reference another node indirectly. The passed in resolve function can be used to lookup other nodes, with the same logic as above. E.g. the following spec looks up the main output of node "abc" and adds a transformed subscription, which is then used as input for current node.
{ stream: (resolve) =>
    resolve("/abc/node").subscribe(map(x => x * 10)) }
  1. Provide an external input stream:
{ stream: () => fromIterable([1,2,3], 500) }
  1. Single value input stream:
{ const: 1 }
{ const: () => 1 }

If the optional xform is given, a subscription with the given transducer is added to the input and then used as input instead.

Hierarchy

  • NodeInputSpec

Index

Properties

Optional const

const: any | ((resolve: ResolveFn) => any)

Optional id

id: undefined | string

Optional path

path: Path

Optional stream

stream: string | ((resolve: ResolveFn) => ISubscribable<any>)

Optional xform

xform: Transducer<any, any>

Generated using TypeDoc