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

reacterjs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reacterjs

A simple Object that can start a chain of reactions after a chain of events

  • 0.5.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Reacter

A simple Object that can start a chain of actions after a chain of events

The user can define the chain of events/actions as a simple string with the following format:

event1 - event2[;<timeout>ms] ... > action1[;<timer>ms] - action2[;<timer>ms] - action3[;<timer>ms]

Simple rules

  1. events and actions are simply strings
  2. - is used as separator on both events and actions
  3. it expects > as separator between events and actions
  4. it expects ; as timeout/timer separator
  5. both the timeout and the timer should have the ms suffix
  6. given the above rules you cannot use - and > on your events/actions strings

example:

const Reacter = require('reacter');
let reacter = new Reacter("e1 - e2;30ms > a1 - a2;30ms");
reacter.on('reaction', console.log.bind(console));
reacter.process('e1').process('e2');

In this case when Reacter gets an event e1 followed by and event e2 fired less than 30ms from e1 it will immediatly emit a reaction with a1 followed by a reaction with a2 after ~30ms

FAQs

Package last updated on 29 Oct 2017

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