Skip to content

ChainGraph API Documentation / @badaitech/chaingraph-types / reducePorts

Function: reducePorts() ​

reducePorts<T>(node, reducer, initialValue): T

Defined in: packages/chaingraph-types/src/node/traverse-ports.ts:86

Reduce ports of a node

Type Parameters ​

T ​

T

Parameters ​

node ​

INode

Node to reduce

reducer ​

(accumulator, port) => T

Reducer function

initialValue ​

T

Initial value

Returns ​

T

Reduced value

Licensed under BUSL-1.1