Redux toolkit (#115)
* add @redux/toolkit * bump react version to allow for hooks * add remote-redux devtools to help track extension state * add remote-redux server to allow for remote state viewing * setup react-redux for current user * setup watch mode for running redux remote dev watch to options * move screenshots
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { browser } from 'webextension-polyfill-ts';
|
||||
import config from '../config';
|
||||
import config from '../config/config';
|
||||
|
||||
type ColorIconTypes = 'gray' | 'red' | 'white' | '';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import config, { ApiStates } from '../config';
|
||||
import config, { ApiStates } from '../config/config';
|
||||
|
||||
import changeExtensionIcon from './changeExtensionIcon';
|
||||
import changeExtensionTooltip from './changeExtensionTooltip';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { browser } from 'webextension-polyfill-ts';
|
||||
import config from '../config';
|
||||
import config from '../config/config';
|
||||
|
||||
/**
|
||||
* It changes the extension title
|
||||
|
||||
16
src/utils/checkCurrentUser.ts
Normal file
16
src/utils/checkCurrentUser.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { RootStore } from '../stores/createStore';
|
||||
import { fetchCurrentUser } from '../reducers/currentUser';
|
||||
|
||||
type unsub = () => void;
|
||||
export default (store: RootStore) => (time: number): unsub => {
|
||||
const fetchUser = () => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
store.dispatch(fetchCurrentUser());
|
||||
};
|
||||
fetchUser();
|
||||
const timeout = setInterval(fetchUser, time);
|
||||
return () => {
|
||||
clearInterval(timeout);
|
||||
};
|
||||
};
|
||||
1
src/utils/isProd.ts
Normal file
1
src/utils/isProd.ts
Normal file
@@ -0,0 +1 @@
|
||||
export default (): boolean => process.env.NODE_ENV !== 'development';
|
||||
Reference in New Issue
Block a user