Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/admin/users/store.ts
1496 views
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { List } from "immutable";
7
8
import { Store, TypedMap, redux } from "../../app-framework";
9
import { User as UserInterface } from "../../frame-editors/generic/client";
10
11
export type User = TypedMap<UserInterface>;
12
13
export interface StoreState {
14
view?: boolean; // if true, open for viewing/editing
15
16
state: "edit" | "running";
17
status: string;
18
query: string;
19
limit: number;
20
result: List<User>;
21
}
22
23
export const initial_state: StoreState = {
24
view: false,
25
state: "edit",
26
status: "",
27
query: "",
28
limit: 25,
29
result: List([]),
30
};
31
32
export class AdminUsersStore extends Store<StoreState> {}
33
34
export const store = redux.createStore(
35
"admin-users",
36
AdminUsersStore,
37
initial_state,
38
);
39
40