mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-09 15:54:47 -07:00
refactor redux data model
This commit is contained in:
parent
ae1bc3da38
commit
0ff391491d
243 changed files with 5212 additions and 5963 deletions
|
|
@ -1,5 +1,32 @@
|
|||
export { AdminService } from './AdminService';
|
||||
export { AuthenticationService } from './AuthenticationService';
|
||||
export { ModeratorService } from './ModeratorService';
|
||||
export { RoomsService } from './RoomsService';
|
||||
export { SessionService } from './SessionService';
|
||||
import { WebClient } from '@app/websocket';
|
||||
import type { IWebClientRequest } from '@app/websocket';
|
||||
|
||||
export { createWebClientResponse } from './response';
|
||||
export { createWebClientRequest } from './request';
|
||||
|
||||
/**
|
||||
* UI-facing request surface. Each property is a lazy getter that resolves
|
||||
* `WebClient.instance` at call time, so consumers can import this before the
|
||||
* singleton is bootstrapped — it only needs to exist by the first actual call.
|
||||
*
|
||||
* Prefer this over importing `WebClient` directly: it keeps UI code free of
|
||||
* transport-layer names and makes `@app/websocket` an internal detail of the
|
||||
* `api` layer.
|
||||
*/
|
||||
export const request: IWebClientRequest = {
|
||||
get authentication() {
|
||||
return WebClient.instance.request.authentication;
|
||||
},
|
||||
get session() {
|
||||
return WebClient.instance.request.session;
|
||||
},
|
||||
get rooms() {
|
||||
return WebClient.instance.request.rooms;
|
||||
},
|
||||
get admin() {
|
||||
return WebClient.instance.request.admin;
|
||||
},
|
||||
get moderator() {
|
||||
return WebClient.instance.request.moderator;
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue