From 9ba7a10f85302d10ea36a2dbe8bdfd8efb45a2ba Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Tue, 21 Feb 2017 21:52:44 +0100 Subject: [PATCH] Fix linting errors (#1235) --- examples/with-refnux/helpers/getStore.js | 4 ++-- examples/with-refnux/helpers/withRefnux.js | 9 +++------ examples/with-refnux/pages/page1.js | 4 ++-- examples/with-refnux/pages/page2.js | 5 ++--- examples/with-refnux/store/counterIncrement.js | 2 +- examples/with-refnux/store/getInitialState.js | 4 ++-- examples/with-refnux/store/getStore.js | 4 ++-- examples/with-refnux/store/setTitle.js | 2 +- 8 files changed, 15 insertions(+), 19 deletions(-) diff --git a/examples/with-refnux/helpers/getStore.js b/examples/with-refnux/helpers/getStore.js index 86a41560..62ef34c4 100644 --- a/examples/with-refnux/helpers/getStore.js +++ b/examples/with-refnux/helpers/getStore.js @@ -4,7 +4,7 @@ let storeMemoized = null const getStore = (initialState) => { let store = null - if (typeof window == 'undefined') { + if (typeof window === 'undefined') { store = createStore(initialState) } else { if (!storeMemoized) { @@ -15,4 +15,4 @@ const getStore = (initialState) => { return store } -export default getStore \ No newline at end of file +export default getStore diff --git a/examples/with-refnux/helpers/withRefnux.js b/examples/with-refnux/helpers/withRefnux.js index 19fe6922..2e32b216 100644 --- a/examples/with-refnux/helpers/withRefnux.js +++ b/examples/with-refnux/helpers/withRefnux.js @@ -1,5 +1,4 @@ -import { Provider} from 'refnux' - +import {Provider} from 'refnux' import getStore from './getStore' // The `withRefnux` "decorator" @@ -9,12 +8,11 @@ import getStore from './getStore' // - passes `store` to Component's `getInitialProps` so that it can dispatch actions const withRefnux = (getInitialState, Component) => { - const Wrapper = (props) => { var store = props.store // if getInitialProps was executed on the server we get a store // that's missing non-serializable functions. - // Because of this we need to recreate the store based on the + // Because of this we need to recreate the store based on the // state coming from the server. if (!store.dispatch) { store = getStore(props.store.state) @@ -38,5 +36,4 @@ const withRefnux = (getInitialState, Component) => { return Wrapper } - -export default withRefnux \ No newline at end of file +export default withRefnux diff --git a/examples/with-refnux/pages/page1.js b/examples/with-refnux/pages/page1.js index 836379d1..9978df20 100644 --- a/examples/with-refnux/pages/page1.js +++ b/examples/with-refnux/pages/page1.js @@ -14,7 +14,7 @@ const Page1 = connect(

{state.title}

Current state: {JSON.stringify(state, null, 2)}

- + ) @@ -25,4 +25,4 @@ Page1.getInitialProps = async function (context) { return {} // we have a store, we don't need props! } -export default withRefnux(getInitialState, Page1) \ No newline at end of file +export default withRefnux(getInitialState, Page1) diff --git a/examples/with-refnux/pages/page2.js b/examples/with-refnux/pages/page2.js index 44586fd5..5eb52425 100644 --- a/examples/with-refnux/pages/page2.js +++ b/examples/with-refnux/pages/page2.js @@ -14,7 +14,7 @@ const Page2 = connect(

{state.title}

Current state: {JSON.stringify(state, null, 2)}

- + ) @@ -24,5 +24,4 @@ Page2.getInitialProps = async function (context) { return {} } - -export default withRefnux(getInitialState, Page2) \ No newline at end of file +export default withRefnux(getInitialState, Page2) diff --git a/examples/with-refnux/store/counterIncrement.js b/examples/with-refnux/store/counterIncrement.js index 697705a5..ce1db930 100644 --- a/examples/with-refnux/store/counterIncrement.js +++ b/examples/with-refnux/store/counterIncrement.js @@ -3,4 +3,4 @@ const counterIncrement = ({counter}, dispatch) => { return { counter: counter + 1 } } -export default counterIncrement \ No newline at end of file +export default counterIncrement diff --git a/examples/with-refnux/store/getInitialState.js b/examples/with-refnux/store/getInitialState.js index fe4620d9..4cb2ed73 100644 --- a/examples/with-refnux/store/getInitialState.js +++ b/examples/with-refnux/store/getInitialState.js @@ -3,6 +3,6 @@ const getInitialState = () => { title: '', counter: 0 } -} +} -export default getInitialState \ No newline at end of file +export default getInitialState diff --git a/examples/with-refnux/store/getStore.js b/examples/with-refnux/store/getStore.js index c4c2b632..89ed4076 100644 --- a/examples/with-refnux/store/getStore.js +++ b/examples/with-refnux/store/getStore.js @@ -4,7 +4,7 @@ const storeInitialState = { counter: 0, key: 'value' } const getStore = () => { let store = null - if (typeof window == 'undefined') { + if (typeof window === 'undefined') { store = createStore(storeInitialState) } else { store = window.store || createStore(storeInitialState) @@ -13,4 +13,4 @@ const getStore = () => { return store } -export default getStore \ No newline at end of file +export default getStore diff --git a/examples/with-refnux/store/setTitle.js b/examples/with-refnux/store/setTitle.js index 18220795..86f2b031 100644 --- a/examples/with-refnux/store/setTitle.js +++ b/examples/with-refnux/store/setTitle.js @@ -3,4 +3,4 @@ const setTitle = (newTitle) => ({title}) => { return { title: newTitle } } -export default setTitle \ No newline at end of file +export default setTitle