Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ba7a10

Browse files
authored
Fix linting errors (vercel#1235)
1 parent 7d4d709 commit 9ba7a10

File tree

8 files changed

+15
-19
lines changed

8 files changed

+15
-19
lines changed

examples/with-refnux/helpers/getStore.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let storeMemoized = null
44

55
const getStore = (initialState) => {
66
let store = null
7-
if (typeof window == 'undefined') {
7+
if (typeof window === 'undefined') {
88
store = createStore(initialState)
99
} else {
1010
if (!storeMemoized) {
@@ -15,4 +15,4 @@ const getStore = (initialState) => {
1515
return store
1616
}
1717

18-
export default getStore
18+
export default getStore

examples/with-refnux/helpers/withRefnux.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { Provider} from 'refnux'
2-
1+
import {Provider} from 'refnux'
32
import getStore from './getStore'
43

54
// The `withRefnux` "decorator"
@@ -9,12 +8,11 @@ import getStore from './getStore'
98
// - passes `store` to Component's `getInitialProps` so that it can dispatch actions
109

1110
const withRefnux = (getInitialState, Component) => {
12-
1311
const Wrapper = (props) => {
1412
var store = props.store
1513
// if getInitialProps was executed on the server we get a store
1614
// that's missing non-serializable functions.
17-
// Because of this we need to recreate the store based on the
15+
// Because of this we need to recreate the store based on the
1816
// state coming from the server.
1917
if (!store.dispatch) {
2018
store = getStore(props.store.state)
@@ -38,5 +36,4 @@ const withRefnux = (getInitialState, Component) => {
3836
return Wrapper
3937
}
4038

41-
42-
export default withRefnux
39+
export default withRefnux

examples/with-refnux/pages/page1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const Page1 = connect(
1414
<h3>{state.title}</h3>
1515
<p>Current state: {JSON.stringify(state, null, 2)}</p>
1616
<button onClick={() => dispatch(counterIncrement)} >Increment</button>
17-
<Link href="/page2"><button>go to page 2</button></Link>
17+
<Link href='/page2'><button>go to page 2</button></Link>
1818
</div>
1919
)
2020

@@ -25,4 +25,4 @@ Page1.getInitialProps = async function (context) {
2525
return {} // we have a store, we don't need props!
2626
}
2727

28-
export default withRefnux(getInitialState, Page1)
28+
export default withRefnux(getInitialState, Page1)

examples/with-refnux/pages/page2.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const Page2 = connect(
1414
<h3>{state.title}</h3>
1515
<p>Current state: {JSON.stringify(state, null, 2)}</p>
1616
<button onClick={() => dispatch(counterIncrement)} >Increment</button>
17-
<Link href="/page1"><button>go to page 2</button></Link>
17+
<Link href='/page1'><button>go to page 2</button></Link>
1818
</div>
1919
)
2020

@@ -24,5 +24,4 @@ Page2.getInitialProps = async function (context) {
2424
return {}
2525
}
2626

27-
28-
export default withRefnux(getInitialState, Page2)
27+
export default withRefnux(getInitialState, Page2)

examples/with-refnux/store/counterIncrement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ const counterIncrement = ({counter}, dispatch) => {
33
return { counter: counter + 1 }
44
}
55

6-
export default counterIncrement
6+
export default counterIncrement

examples/with-refnux/store/getInitialState.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ const getInitialState = () => {
33
title: '',
44
counter: 0
55
}
6-
}
6+
}
77

8-
export default getInitialState
8+
export default getInitialState

examples/with-refnux/store/getStore.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const storeInitialState = { counter: 0, key: 'value' }
44

55
const getStore = () => {
66
let store = null
7-
if (typeof window == 'undefined') {
7+
if (typeof window === 'undefined') {
88
store = createStore(storeInitialState)
99
} else {
1010
store = window.store || createStore(storeInitialState)
@@ -13,4 +13,4 @@ const getStore = () => {
1313
return store
1414
}
1515

16-
export default getStore
16+
export default getStore

examples/with-refnux/store/setTitle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ const setTitle = (newTitle) => ({title}) => {
33
return { title: newTitle }
44
}
55

6-
export default setTitle
6+
export default setTitle

0 commit comments

Comments
 (0)