Skip to content

Instantly share code, notes, and snippets.

@Maarten88
Created March 19, 2017 23:34
Show Gist options
  • Save Maarten88/a739793a3ad48e33b016d7b201beec1f to your computer and use it in GitHub Desktop.
Save Maarten88/a739793a3ad48e33b016d7b201beec1f to your computer and use it in GitHub Desktop.
[...]
export default createServerRenderer(params => {
return new Promise<RenderResult>((resolve, reject) => {
// Match the incoming request against the list of client-side routes
match({ routes, location: params.location }, (error, redirectLocation, renderProps: any) => {
[...]
// Build an instance of the application
const store = configureStore();
store.dispatch({ type: INIT_SESSION, payload: { xsrfToken: params.data.xsrfToken, id: params.data.sessionId } });
[...]
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment