Replace Webpack with Vite (#4765)

Co-authored-by: Tom Moor <tom@getoutline.com>
Co-authored-by: Vio <vio@beanon.com>
This commit is contained in:
Hans Pagel
2023-02-16 04:39:46 +01:00
committed by GitHub
parent 490d05b68b
commit e754f89e5c
40 changed files with 1646 additions and 3565 deletions

View File

@@ -1,5 +1,5 @@
import invariant from "invariant";
import { orderBy } from "lodash";
import { lowerFirst, orderBy } from "lodash";
import { observable, action, computed, runInAction } from "mobx";
import { Class } from "utility-types";
import RootStore from "~/stores/RootStore";
@@ -20,10 +20,6 @@ export enum RPCAction {
type FetchPageParams = PaginationParams & Record<string, any>;
function modelNameFromClassName(string: string) {
return string.charAt(0).toLowerCase() + string.slice(1);
}
export const DEFAULT_PAGINATION_LIMIT = 25;
export const PAGINATION_SYMBOL = Symbol.for("pagination");
@@ -61,7 +57,7 @@ export default abstract class BaseStore<T extends BaseModel> {
constructor(rootStore: RootStore, model: Class<T>) {
this.rootStore = rootStore;
this.model = model;
this.modelName = modelNameFromClassName(model.name);
this.modelName = lowerFirst(model.name);
if (!this.apiEndpoint) {
this.apiEndpoint = `${this.modelName}s`;