mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-04-20 03:00:24 -04:00
39 lines
793 B
TypeScript
39 lines
793 B
TypeScript
import { createModel } from 'xstate/lib/model';
|
|
import { ActivityLog } from '../../machines/activityLog';
|
|
import { AppServices } from '../../shared/GlobalContext';
|
|
|
|
const model = createModel(
|
|
{
|
|
serviceRefs: {} as AppServices,
|
|
activities: [] as ActivityLog[],
|
|
},
|
|
{
|
|
events: {},
|
|
}
|
|
);
|
|
|
|
export const HistoryTabEvents = model.events;
|
|
|
|
export const HistoryTabMachine = model.createMachine(
|
|
{
|
|
predictableActionArguments: true,
|
|
preserveActionOrder: true,
|
|
id: 'HistoryTab',
|
|
context: model.initialContext,
|
|
initial: 'idle',
|
|
states: {
|
|
idle: {},
|
|
},
|
|
},
|
|
{
|
|
actions: {},
|
|
}
|
|
);
|
|
|
|
export function createHistoryTabMachine(serviceRefs: AppServices) {
|
|
return HistoryTabMachine.withContext({
|
|
...HistoryTabMachine.context,
|
|
serviceRefs,
|
|
});
|
|
}
|