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:
Vu Nguyen
2021-01-22 16:37:59 -08:00
committed by GitHub
parent 0c39fbbc79
commit 8ade367b3f
20 changed files with 1859 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
import { browser } from 'webextension-polyfill-ts';
import config from '../config';
import config from '../config/config';
type ColorIconTypes = 'gray' | 'red' | 'white' | '';

View File

@@ -1,4 +1,4 @@
import config, { ApiStates } from '../config';
import config, { ApiStates } from '../config/config';
import changeExtensionIcon from './changeExtensionIcon';
import changeExtensionTooltip from './changeExtensionTooltip';

View File

@@ -1,5 +1,5 @@
import { browser } from 'webextension-polyfill-ts';
import config from '../config';
import config from '../config/config';
/**
* It changes the extension title

View 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
View File

@@ -0,0 +1 @@
export default (): boolean => process.env.NODE_ENV !== 'development';