Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiki for next components #609

Closed
matthewmueller opened this issue Jan 2, 2017 · 1 comment
Closed

Wiki for next components #609

matthewmueller opened this issue Jan 2, 2017 · 1 comment

Comments

@matthewmueller
Copy link
Contributor

matthewmueller commented Jan 2, 2017

Finding myself making a bunch of little snippets to make things work on both client and server inside the getInitialProps – it'd be great to have a place to share these modules.

I'll start with one :-)

Here's a basic redirect one:

function redirect (ctx, path) {
  if (ctx.res) ctx.res.writeHead(302, { Location: path })
  else document.location.pathname = path
}

Some other ideas:

  • alert(...) : that opens up a nice modal or top banner on client, console.error's on the server
@rauchg
Copy link
Member

rauchg commented Jan 2, 2017

Just made the Wikis public 🎉

@rauchg rauchg closed this as completed Jan 2, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants