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
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();
}
}
await processStore.load(MyProcess)