mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-25 08:30:58 -05:00
chore(mobx): clean up documentation
This commit is contained in:
parent
49f45aa5aa
commit
830b24a393
7 changed files with 16 additions and 16 deletions
|
@ -47,6 +47,9 @@
|
|||
"ClassDeclaration": true,
|
||||
"ArrowFunctionExpression": false,
|
||||
"FunctionExpression": false
|
||||
},
|
||||
"ignore": {
|
||||
"MethodDefinition": ["toJSON", "hydrate"]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -26,7 +26,6 @@ export default class Auth implements Persistent<Data> {
|
|||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
toJSON() {
|
||||
return {
|
||||
sessions: this.sessions,
|
||||
|
@ -34,7 +33,6 @@ export default class Auth implements Persistent<Data> {
|
|||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
hydrate(data: Data) {
|
||||
Object.keys(data.sessions).forEach((id) =>
|
||||
this.sessions.set(id, data.sessions[id]),
|
||||
|
|
|
@ -20,14 +20,12 @@ export default class Draft implements Persistent<Data> {
|
|||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
toJSON() {
|
||||
return {
|
||||
drafts: this.drafts,
|
||||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
@action hydrate(data: Data) {
|
||||
Object.keys(data.drafts).forEach((key) =>
|
||||
this.drafts.set(key, data.drafts[key]),
|
||||
|
|
|
@ -2,16 +2,25 @@ import { action, computed, makeAutoObservable, ObservableSet } from "mobx";
|
|||
|
||||
import Persistent from "../Persistent";
|
||||
|
||||
export type Experiment = "search" | "theme_shop";
|
||||
/**
|
||||
* Union type of available experiments.
|
||||
*/
|
||||
export type Experiment = "dummy" | "theme_shop";
|
||||
|
||||
/**
|
||||
* Currently active experiments.
|
||||
*/
|
||||
export const AVAILABLE_EXPERIMENTS: Experiment[] = ["theme_shop"];
|
||||
|
||||
/**
|
||||
* Definitions for experiments listed by {@link Experiment}.
|
||||
*/
|
||||
export const EXPERIMENTS: {
|
||||
[key in Experiment]: { title: string; description: string };
|
||||
} = {
|
||||
search: {
|
||||
title: "Search",
|
||||
description: "Allows you to search for messages in channels.",
|
||||
dummy: {
|
||||
title: "Dummy Experiment",
|
||||
description: "This is a dummy experiment.",
|
||||
},
|
||||
theme_shop: {
|
||||
title: "Theme Shop",
|
||||
|
@ -37,14 +46,12 @@ export default class Experiments implements Persistent<Data> {
|
|||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
toJSON() {
|
||||
return {
|
||||
enabled: this.enabled,
|
||||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
@action hydrate(data: Data) {
|
||||
if (data.enabled) {
|
||||
for (const experiment of data.enabled) {
|
||||
|
|
|
@ -22,14 +22,12 @@ export default class Experiments implements Persistent<Data> {
|
|||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
toJSON() {
|
||||
return {
|
||||
server: this.server,
|
||||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
@action hydrate(data: Data) {
|
||||
if (data.server) {
|
||||
Object.keys(data.server).forEach((key) =>
|
||||
|
|
|
@ -63,14 +63,12 @@ export default class LocaleOptions implements Persistent<Data> {
|
|||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
toJSON() {
|
||||
return {
|
||||
lang: this.lang,
|
||||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
@action hydrate(data: Data) {
|
||||
this.setLanguage(data.lang);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,6 @@ export default class NotificationOptions implements Persistent<Data> {
|
|||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
toJSON() {
|
||||
return {
|
||||
server: this.server,
|
||||
|
@ -52,7 +51,6 @@ export default class NotificationOptions implements Persistent<Data> {
|
|||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line require-jsdoc
|
||||
@action hydrate(data: Data) {
|
||||
if (data.server) {
|
||||
Object.keys(data.server).forEach((key) =>
|
||||
|
|
Loading…
Reference in a new issue