CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/admin/users/store.ts
Views: 687
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
result: List<User>;
20
}
21
22
export const initial_state: StoreState = {
23
view: false,
24
state: "edit",
25
status: "",
26
query: "",
27
result: List([]),
28
};
29
30
export class AdminUsersStore extends Store<StoreState> {}
31
32
export const store = redux.createStore(
33
"admin-users",
34
AdminUsersStore,
35
initial_state
36
);
37
38