/hflow

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Contributors

Unit tests CI CICD.Build Playwright E2E CircleCI Gitpod Ready-to-Code

hflow

  • Install
$ npm install
  • Start
$ npm run start:linux / windows

Useful links

Hooks

Saga Model Effect creators

  • https://redux-saga.js.org/docs/api

  • actionChannel(pattern, [buffer]): Creates an effect that instructs the middleware to queue the actions matching pattern using an event channel. Optionally, you can provide a buffer to control buffering of the queued actions.

  • all([...effects]) - parallel effects: Creates an Effect description that instructs the middleware to run multiple Effects in parallel and wait for all of them to complete. It's quite the corresponding API to standard Promise#all.

  • call(fn, ...args): Creates an Effect description that instructs the middleware to call the function fn with args as arguments.

  • cancel(task): Creates an Effect description that instructs the middleware to cancel a previously forked task.

  • cancelled(): Creates an effect that instructs the middleware to return whether this generator has been cancelled. Typically, you use this Effect in a final block to run Cancellation specific code.

  • cps(fn, ...args): Creates an Effect description that instructs the middleware to invoke fn as a Node style function.

  • flush(channel): Creates an effect that instructs the middleware to flush all buffered items from the channel. Flushed items are returned back to the saga, so they can be utilized if needed.

  • fork(fn, ...args): Creates an Effect description that instructs the middleware to perform a non-blocking call on fn

  • getContext(prop): Creates an effect that instructs the middleware to return a specific property of saga's context.

  • join(task): Creates an Effect description that instructs the middleware to wait for the result of a previously forked task.

  • put(action): Creates an Effect description that instructs the middleware to schedule the dispatching of an action to the store. This dispatch may not be immediate since other tasks might lie ahead in the saga task queue or still be in progress.

  • race(effects): Creates an Effect description that instructs the middleware to run a Race between multiple Effects (this is similar to how Promise.race([...]) behaves).

  • setContext(props): Creates an effect that instructs the middleware to update its own context. This effect extends saga's context instead of replacing it.

  • select(selector, ...args): Creates an effect that instructs the middleware to invoke the provided selector on the current Store's state.

  • spawn(fn, ...args): Same as fork(fn, ...args) but creates a detached task. A detached task remains independent of its parent and acts like a top-level task.

  • take(pattern): Creates an Effect description that instructs the middleware to wait for a specified action on the Store. The Generator is suspended until an action that matches pattern is dispatched.

  • takeEvery(pattern, saga, ...args): Spawns a saga on each action dispatched to the Store that matches pattern.

  • takeLatest(pattern, saga, ...args): Forks a saga on each action dispatched to the Store that matches pattern. And automatically cancels any previous saga task started previously if it's still running.

  • takeMaybe(pattern): Same as take(pattern) but does not automatically terminate the Saga on an END action.

  • throttle(ms, pattern, saga, ...args): Spawns a saga on an action dispatched to the Store that matches pattern.