migration additions -- part 2

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2021-04-20 12:24:06 +03:00
1 parent 9ca7104a2a
commit 95794af5b2
5 files changed
+18 -5

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
// Global configuration setup for external packages.
// Should be imported at the top of app's entry points.
import { configure } from "mobx";
import { enableMapSet, setAutoFreeze } from "immer";
// Mobx
configure({
enforceActions: "never", // allows to skip using @action when class-method updates some state
});
// Immer
setAutoFreeze(false); // allow to merge observables
enableMapSet(); // allow merging maps and sets
+2
View File
@@ -1,4 +1,6 @@
import "./common/libs-config";
import fetchMock from "jest-fetch-mock";
// rewire global.fetch to call 'fetchMock'
fetchMock.enableMocks();
+1
View File
@@ -1,6 +1,7 @@
// Main process
import "../common/system-ca";
import "../common/libs-config"
import "../common/prometheus-providers";
import * as Mobx from "mobx";
import * as LensExtensions from "../extensions/core-api";
+1 -1
View File
@@ -1,5 +1,5 @@
import "./components/app.scss";
import "../common/libs-config";
import React from "react";
import * as Mobx from "mobx";
import * as MobxReact from "mobx-react";
+1 -4
View File
@@ -1,13 +1,10 @@
// Helper for working with storages (e.g. window.localStorage, NodeJS/file-system, etc.)
import { action, comparer, CreateObservableOptions, IObservableValue, observable, reaction, toJS, when } from "mobx";
import produce, { Draft, enableMapSet, setAutoFreeze } from "immer";
import produce, { Draft } from "immer";
import { isEqual, isFunction, isPlainObject, merge } from "lodash";
import logger from "../../main/logger";
setAutoFreeze(false); // allow to merge observables
enableMapSet(); // allow merging maps and sets
export interface StorageAdapter<T> {
[metadata: string]: any;
getItem(key: string): T | Promise<T>;