Model which helps to use pagination with tables
import { Paginator } from 'mobx-shared-entities/paginator';
class SomeModel {
paginator = new Paginator({
disposer: this.disposer,
});
}
someModel.paginator.toNextPage()
someModel.paginator.toPreviousPage()
someModel.paginator.inputData;
Model which helps to create ws connection with sending\receiving data from ws
import { Socket } from 'mobx-shared-entities/socket';
class SomeModel {
socket = new Socket({
url: 'ws//localhost:8081',
reconnect: { enabled: true },
});
}
someModel.socket.open();
reaction(
() => someModel.socker.message,
(message) => {
console.info('message', message);
},
);
Model which helps to create step mechanism
import { Stepper } from 'mobx-shared-entities/stepper';
class SomeModel {
stepper = new Stepper({
steps: [1, 2, 3],
});
}
someModel.stepper.nextStep()
someModel.stepper.isLastStep;
someModel.stepper.activeStep;
Model with counter and start timer
import { Ticker } from 'mobx-shared-entities/ticker';
class SomeModel {
ticker = new Ticker({
ticksPer: 1_000,
});
}
someModel.ticker.start();
reaction(
() => someModel.ticker.ticks,
(ticks) => {
console.info('ticks', ticks);
},
);
Shared code for UI tabs
import { TabManager } from 'mobx-shared-entities/tab-manager';
class SomeModel {
tabs = new TabManager({
tabs: [
{ id: '1' },
{ id: '2' },
]
});
}
someModel.tabs.setActiveTab('1');
reaction(
() => someModel.tabs.activeTabData,
(activeTabData) => {
console.info('activeTabData', activeTabData);
},
);