Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tyleroooo committed Dec 20, 2024
1 parent cc93cb7 commit de0b0d0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@
"no-multi-assign": "off",
"no-nested-ternary": "off",
"no-param-reassign": ["error", { "props": false }],
"no-restricted-imports": [
"error",
{
"patterns": [
"@/abacus-ts/*",
"!@/abacus-ts/ontology",
"!@/abacus-ts/lib",
"!@/abacus-ts/summaryTypes"
]
}
],
"no-return-assign": "off",
"no-return-await": "off",
"no-underscore-dangle": "off",
Expand Down
1 change: 1 addition & 0 deletions src/abacus-ts/ontology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type NestedSelectors = {

// all data should be accessed via selectrs in this file
// no files outside abacus-ts should access anything within abacus-ts except this file
// TODO - enforce this via eslint
export const MegalodonCore = {
account: {
parentSubaccountSummary: {
Expand Down
14 changes: 6 additions & 8 deletions src/state/_store.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// eslint-disable-next-line no-restricted-imports
import { storeLifecycles } from '@/abacus-ts/storeLifecycles';
import { Middleware, combineReducers, configureStore } from '@reduxjs/toolkit';
import { persistReducer, persistStore } from 'redux-persist';
import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2';
import storage from 'redux-persist/lib/storage';

import abacusStateManager from '@/lib/abacus';
import { runFn } from '@/lib/do';
import { testFlags } from '@/lib/testFlags';

import { accountSlice } from './account';
import { accountUiMemorySlice } from './accountUiMemory';
Expand Down Expand Up @@ -98,13 +99,10 @@ export const persistor = persistStore(store);
// Set store so (Abacus & v4-Client) classes can getState and dispatch
abacusStateManager.setStore(store);

if (testFlags.useAbacusTs) {
runFn(async () => {
const { storeLifecycles } = await import('@/abacus-ts/storeLifecycles');
// we ignore the cleanups for now since we want these running forever
storeLifecycles.forEach((fn) => fn(store));
});
}
runFn(async () => {
// we ignore the cleanups for now since we want these running forever
storeLifecycles.forEach((fn) => fn(store));
});

export type RootStore = typeof store;
export type RootState = ReturnType<typeof store.getState>;
Expand Down
1 change: 1 addition & 0 deletions src/state/raw.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Loadable, loadableIdle } from '@/abacus-ts/lib/loadable';
// eslint-disable-next-line no-restricted-imports
import {
AssetInfos,
MarketsData,
Expand Down

0 comments on commit de0b0d0

Please sign in to comment.