0.0.9 • Published 6 months ago

mobx-process v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

mobx-process

NPM version build status npm download bundle size

MobX code blocks working by start\stop mechanism

Main goal which these "processes" are needed is the executing some business logic across whole application. Naming "process" was borrowed from FSD architectural methodology. More about this idea of this process implementation you can read here

Usage

1. Create instance of the ProcessStore

You can create your own implementation or use ready from package.

import { ProcessStoreImpl } from "mobx-process";

const processStore = new ProcessStoreImpl();

2. Create implementation of the Process

Or you can use ready from package.

import { Process, ProcessImpl } from "mobx-process";

export class MyProcess extends ProcessImpl implements Process {
  childProcesses = [];

  async start() {
    // do some logic
    await super.start();
  }

  async stop() {
    await super.stop();
  }
}

3. Load process into store

await processStore.load(MyProcess)
0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago