@jsfx/effects

0.1.12 • Public • Published

@jsfx/effects

@jsfx/utils introduces the iterate method for iterating over a generator with a defined protocol.

@jsfx/effects introduces several new concepts which leverage the iterate method.

This library introduces several effects which can be composed in any generator passed to emit.

Definitions

  • Effect - a pair of functions an emitter and receiver which communicate via a signal.
  • Emitter - a function which returns a signal.
  • Receiver - a function which accepts a signal.
  • Signal - an abstracted communication object.

Effects

  • all - Call each of the promises in an iterable calling a callback with the results when they resolve.
  • call - Call a function, or generator with the supplied arguments.
  • promise - Call a promise yielding the result or an error object.
  • race - Call each of the promises in an iterable calling a callback with the first result that resolves.

Methods

  • emit - Invoke an iterator using the @jsfx/effects protocol.

Contributing

  • One function per file.
  • Use flow comment types
  • Each file must have 100% flow coverage.
  • Write unit tests
  • Types must end with the word "Type", Iterfaces with "Interface"

Readme

Keywords

none

Package Sidebar

Install

npm i @jsfx/effects

Weekly Downloads

0

Version

0.1.12

License

MIT

Unpacked Size

14.6 kB

Total Files

31

Last publish

Collaborators

  • hansoksendahl