Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nflow

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nflow

event/data/control flow

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

nFlow Build Status

Hierarchical event dispatcher

NPM

Work in progress

API

flow
  .create()
  .create('name') // create a new leaf node from flow
  .create('name', data)

flow
  .name()
  .name('test') 

flow
  .data() // getter
  .data({}) // setter
  .data({},{},{}) //setter with multiple payloads

flow
  .emit() // emit current flow object
  .emit('name') // create and emit 'name'
  .emit('name', data) // create and emit 'name' with data as the payload
  .emit(flow2) // detach and emit an existing flow object

flow
  .parent() // return the parent flow object
  .parent(null) // detach the flow object, creating a new subtree
  .parent(flow) // re-parent the flow object

flow.parents() // return all upstream flow objects

flow
  .direction()
  .direction(flow.direction.DEFAULT)
  .direction(flow.direction.UPSTREAM)
  .direction(flow.direction.DOWNSTREAM)
  .direction(flow.direction.NONE)

flow
  .children() //return all direct descendant nodes
  .children.all() // return all child nodes recursively

flow
  .cancel()
  .cancelled()
  .cancelled(true)

flow
  .stopPropagation()

flow
  .on('name')
  .on('name', handler)
  .on('name', handler1, handler 2)

Internal Events

When a flow object mutates in any way, all connected flow objects are notified of the change.

.data(newData) triggers:

  • .on('flow.data', newData, oldData) on the current flow object
  • .on('flow.children.data', flow, newData, oldData) on all parent objects
  • .on('flow.parent.data', flow, newData, oldData) on all child objects (recursively)

Keywords

FAQs

Package last updated on 08 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc