0.1.9 • Published 2 years ago

@gluecodes/orchiee v0.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Orchiee

Framework-agnostic action orchestrator with an awesome type support

Deploy Orchiee NPM Version

Installation

npm install --save @gluecodes/orchiee

Usage

import * as Fn from '@gluecodes/orchiee';

const someAction = async (): SomeType => {}
const observedSomeAction = Fn.be(someAction)

Fn.observe(Fn.calling(observedSomeAction), (isBeingCalled) => {
  // isBeingCalled is Boolean type
})

Fn.observe(Fn.called(observedSomeAction), (itsReturnedValue) => {
  // itsReturnedValue is SomeType and it's taken from someAction
})

Fn.observe(Fn.failed(observedSomeAction), (error) => {
  // error is Error type
})

Fn.observe(Fn.called(observedSomeAction, Fn.called(action1), Fn.called(action2)), (itsReturnedValue) => {
  // when action1() or action2() is triggered, this callback is triggered
})

// on cleanup of your framework
Fn.cleanup() // clears all listeners

License

MIT

0.1.8

2 years ago

0.1.9

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago