Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
message: e.message,
// $FlowFixMe
code: e.code,
// $FlowFixMe
meta: e.meta,
initialArgs: {hello: 'world'},
},
'dispatches failure with correct payload'
);
return {
...action.payload,
loading: false,
};
},
}),
prepared(props =>
props.message ? Promise.resolve() : props.test({hello: 'world'})
),
connect(s => s)
);
const element = React.createElement(
Provider,
{store},
React.createElement(hoc(Component))
);
const app = new App(element);
app.register(Plugin);
app.register(FetchToken, fetch);
await getSimulator(app)
.render('/')
.catch(e => t.equal(e.message, 'Some failure'));
// $FlowFixMe
fixture.payload,
'dispatches expected action payload'
);
return action.payload;
}, null);
const Component = props => {
t.equal(typeof props.test, 'function', 'passes correct prop to component');
return React.createElement('span', null, 'hello world');
};
const withTest = compose(
withRPCRedux('test'),
connect(s => s),
prepared(props =>
props.message ? Promise.resolve() : props.test({hello: 'world'})
)
)(Component);
const element = React.createElement(
Provider,
{store},
React.createElement(withTest)
);
const app = new App(element);
app.register(Plugin);
app.register(FetchToken, fetch);
await getSimulator(app)
.render('/')
.catch(e => t.equal(e.message, 'message'));
t.equal(expectedActions.length, 0, 'dispatches all actions');
class RPC extends React.Component {
render() {
const {name} = this.props;
console.log('What props do we get', this.props.name);
return <div>RPC DEMO {name}</div>;
}
}
//export default RPC;
const preparedFunc = async (props, context) => {
console.log('What props', context);
const response = await Axios.get('http://localhost:3000/api/user/1');
console.log('AFTER PROMISEResponse come back', response.data);
return {...response.data};
};
export default prepared(preparedFunc, {forceUpdate: true})(RPC);
// export default Styles;