Skip to content

Instantly share code, notes, and snippets.

@jide
Last active April 1, 2022 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jide/f8143d0aa9fe416ba49bfdc590f349ff to your computer and use it in GitHub Desktop.
Save jide/f8143d0aa9fe416ba49bfdc590f349ff to your computer and use it in GitHub Desktop.
export const showPostPage = async ({ state, actions, effects }, params) => {
if (!state.auth.token) {
effects.router.open('/');
}
state.router = { page: 'post', params };
await actions.loadPost({ id: params.id });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment