From e2176d0566698cf7dde1b2e7673e727e1918e0ed Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Sat, 23 Oct 2021 13:57:42 +0800 Subject: [PATCH] Don't connect to the Redux store when not needed. The subscription still costs something per update cycle even when the parameters are null or empty objects. --- ui/component/IframeReact/index.js | 7 +------ ui/component/abandonedChannelPreview/index.js | 5 +---- ui/component/expandable/index.js | 6 +----- ui/component/i18nMessage/index.js | 10 +--------- ui/component/livestreamList/index.js | 5 +---- ui/component/loadingBarOneOff/index.js | 5 +---- ui/component/tag/index.js | 10 +--------- ui/component/youtubeBadge/index.js | 7 +------ ui/page/fourOhFour/index.js | 8 +------- ui/page/receive/index.js | 5 +---- ui/page/reportContent/index.js | 7 +------ ui/page/send/index.js | 5 +---- ui/page/swap/index.js | 5 +---- ui/page/welcome/index.js | 9 +-------- 14 files changed, 14 insertions(+), 80 deletions(-) diff --git a/ui/component/IframeReact/index.js b/ui/component/IframeReact/index.js index 8bc6ea938..d1b2573d3 100644 --- a/ui/component/IframeReact/index.js +++ b/ui/component/IframeReact/index.js @@ -1,8 +1,3 @@ -import { connect } from 'react-redux'; import IframeReact from './view'; -const select = state => ({}); - -const perform = () => ({}); - -export default connect(select, perform)(IframeReact); +export default IframeReact; diff --git a/ui/component/abandonedChannelPreview/index.js b/ui/component/abandonedChannelPreview/index.js index 669f6602e..57dc65915 100644 --- a/ui/component/abandonedChannelPreview/index.js +++ b/ui/component/abandonedChannelPreview/index.js @@ -1,6 +1,3 @@ -import { connect } from 'react-redux'; import AbandonedChannelPreview from './view'; -const select = (state, props) => ({}); - -export default connect(select)(AbandonedChannelPreview); +export default AbandonedChannelPreview; diff --git a/ui/component/expandable/index.js b/ui/component/expandable/index.js index 6dc708a6f..0614faa5b 100644 --- a/ui/component/expandable/index.js +++ b/ui/component/expandable/index.js @@ -1,7 +1,3 @@ -import { connect } from 'react-redux'; import Expandable from './view'; -export default connect( - null, - null -)(Expandable); +export default Expandable; diff --git a/ui/component/i18nMessage/index.js b/ui/component/i18nMessage/index.js index 251abdbbf..a8e8a8750 100644 --- a/ui/component/i18nMessage/index.js +++ b/ui/component/i18nMessage/index.js @@ -1,11 +1,3 @@ -import { connect } from 'react-redux'; import i18n from './view'; -const select = state => ({}); - -const perform = () => ({}); - -export default connect( - select, - perform -)(i18n); +export default i18n; diff --git a/ui/component/livestreamList/index.js b/ui/component/livestreamList/index.js index 3dffaca29..12a998c5a 100644 --- a/ui/component/livestreamList/index.js +++ b/ui/component/livestreamList/index.js @@ -1,6 +1,3 @@ -import { connect } from 'react-redux'; import LivestreamList from './view'; -const select = (state) => ({}); - -export default connect(select)(LivestreamList); +export default LivestreamList; diff --git a/ui/component/loadingBarOneOff/index.js b/ui/component/loadingBarOneOff/index.js index 88ce5627b..bde862b65 100644 --- a/ui/component/loadingBarOneOff/index.js +++ b/ui/component/loadingBarOneOff/index.js @@ -1,6 +1,3 @@ -import { connect } from 'react-redux'; import LoadingBarOneOff from './view'; -const select = (state, props) => ({}); - -export default connect(select)(LoadingBarOneOff); +export default LoadingBarOneOff; diff --git a/ui/component/tag/index.js b/ui/component/tag/index.js index 3429072b1..5ebc0fea9 100644 --- a/ui/component/tag/index.js +++ b/ui/component/tag/index.js @@ -1,11 +1,3 @@ -import { connect } from 'react-redux'; import Tag from './view'; -const select = state => ({}); - -const perform = () => ({}); - -export default connect( - select, - perform -)(Tag); +export default Tag; diff --git a/ui/component/youtubeBadge/index.js b/ui/component/youtubeBadge/index.js index 9e345ec82..e6ded26da 100644 --- a/ui/component/youtubeBadge/index.js +++ b/ui/component/youtubeBadge/index.js @@ -1,8 +1,3 @@ -import { connect } from 'react-redux'; import YoutubeBadge from './view'; -const select = state => ({}); - -const perform = dispatch => ({}); - -export default connect(select, perform)(YoutubeBadge); +export default YoutubeBadge; diff --git a/ui/page/fourOhFour/index.js b/ui/page/fourOhFour/index.js index d6f2d6326..1b6ab9918 100644 --- a/ui/page/fourOhFour/index.js +++ b/ui/page/fourOhFour/index.js @@ -1,9 +1,3 @@ -import { connect } from 'react-redux'; import FourOhFourPage from './view'; -const select = state => ({}); - -export default connect( - select, - null -)(FourOhFourPage); +export default FourOhFourPage; diff --git a/ui/page/receive/index.js b/ui/page/receive/index.js index 5f7bfcb4e..3ab7e695d 100644 --- a/ui/page/receive/index.js +++ b/ui/page/receive/index.js @@ -1,6 +1,3 @@ -import { connect } from 'react-redux'; import ReceivePage from './view'; -const select = (state) => ({}); - -export default connect(select, {})(ReceivePage); +export default ReceivePage; diff --git a/ui/page/reportContent/index.js b/ui/page/reportContent/index.js index 44f483487..6659921d9 100644 --- a/ui/page/reportContent/index.js +++ b/ui/page/reportContent/index.js @@ -1,8 +1,3 @@ -import { connect } from 'react-redux'; import ReportContentPage from './view'; -const select = (state) => ({}); - -const perform = (dispatch) => ({}); - -export default connect(select, perform)(ReportContentPage); +export default ReportContentPage; diff --git a/ui/page/send/index.js b/ui/page/send/index.js index 80835d570..e0b8fe3f8 100644 --- a/ui/page/send/index.js +++ b/ui/page/send/index.js @@ -1,6 +1,3 @@ -import { connect } from 'react-redux'; import SendPage from './view'; -const select = (state) => ({}); - -export default connect(select, null)(SendPage); +export default SendPage; diff --git a/ui/page/swap/index.js b/ui/page/swap/index.js index 8d853b9cf..585e14521 100644 --- a/ui/page/swap/index.js +++ b/ui/page/swap/index.js @@ -1,6 +1,3 @@ -import { connect } from 'react-redux'; import SwapPage from './view'; -const select = (state) => ({}); - -export default connect(select, null)(SwapPage); +export default SwapPage; diff --git a/ui/page/welcome/index.js b/ui/page/welcome/index.js index 860215821..ffbcb22d2 100644 --- a/ui/page/welcome/index.js +++ b/ui/page/welcome/index.js @@ -1,10 +1,3 @@ -import { connect } from 'react-redux'; import Welcome from './view'; -const select = () => ({}); -const perform = () => ({}); - -export default connect( - select, - perform -)(Welcome); +export default Welcome;