client: migrate from Flux to MobX

This commit is contained in:
Jesse Chan
2020-10-23 13:20:10 +08:00
parent 4908617503
commit 0e57e36663
108 changed files with 2328 additions and 4971 deletions
-10
View File
@@ -3,7 +3,6 @@ import type {Request, Response} from 'express';
import type TypedEmitter from 'typed-emitter';
import type {HistorySnapshot} from '@shared/constants/historySnapshotTypes';
import type {TransferHistory} from '@shared/types/TransferData';
import DiskUsage from '../models/DiskUsage';
import ServerEvent from '../models/ServerEvent';
@@ -89,15 +88,6 @@ export default async (req: Request<unknown, unknown, unknown, {historySnapshot:
});
// Add user's specified history snapshot change event listener.
handleEvents(
serviceInstances.historyService,
`${historySnapshot}_SNAPSHOT_FULL_UPDATE` as 'FIVE_MINUTE_SNAPSHOT_FULL_UPDATE',
(payload: {id: number; data: TransferHistory}) => {
const {data, id} = payload;
serverEvent.emit(id, 'TRANSFER_HISTORY_FULL_UPDATE', data);
},
);
handleEvents(serviceInstances.notificationService, 'NOTIFICATION_COUNT_CHANGE', (payload) => {
const {data, id} = payload;
serverEvent.emit(id, 'NOTIFICATION_COUNT_CHANGE', data);