Skip to content

Commit

Permalink
move trigger options to a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bertho-zero committed Mar 31, 2018
1 parent c986b0d commit 98a9386
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/components/ReduxAsyncConnect/ReduxAsyncConnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,18 @@ export default class ReduxAsyncConnect extends Component {

// load data while the old screen remains
const { components, match, params } = await asyncMatchRoutes(routes, nextProps.location.pathname);

await trigger('fetch', components, {
const triggerLocals = {
...helpers,
store,
match,
params,
history,
location: nextProps.location
});
};

await trigger('fetch', components, triggerLocals);
if (__CLIENT__) {
await trigger('defer', components, {
...helpers,
store,
match,
history,
location: nextProps.location
});
await trigger('defer', components, triggerLocals);
}

// clear previousLocation so the next screen renders
Expand Down

0 comments on commit 98a9386

Please sign in to comment.