diff --git a/src/index.js b/src/index.js index 602e269..8500aa2 100644 --- a/src/index.js +++ b/src/index.js @@ -28,7 +28,7 @@ const withJet = (mapStateToConnection, fetchers = {}) => { } } - componentWillMount () { + componentDidMount () { this.fetchAll(this.props.connection) } diff --git a/test/index.js b/test/index.js index 3e5dd00..f431a2b 100644 --- a/test/index.js +++ b/test/index.js @@ -114,7 +114,7 @@ describe('withJet', () => { type: 'SET_CONNECTION', connection: {url: 'ws://localhost:1999', user: 'admin', password: '333'} }) - } else if (user === 'admin' && state.admin && !once) { + } else if (user === 'admin' && state.admin && state.foo && !once) { assert.equal(state.admin, 'secret') assert.equal(wrapper.find('h1').text(), 'secret123') assert(wasJohn)