Skip to content

Dealing with GoRouter redirection/route-guards. #109

Closed Answered by GregoryConrad
Kypsis asked this question in Q&A
Discussion options

You must be logged in to vote

That seems satisfactory to me. Only two changes I’d suggest:

  1. add the two listeners to the dependencies list of the use.effect
  2. Make an extension on Container that has a method called something like “listenableOf” that returns a Listenable + a dispose (which maybe you could automatically handle based on listener count, but that seems out of the scope for what you’re specifically trying to do)

And be very sure that the build will not be called ever again. You can toss that listenable init stuff and the GoRouter() call in a use.callonce if you need to.

I think I’d accept a PR for 2. above, if you were willing.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Kypsis
Comment options

@GregoryConrad
Comment options

Answer selected by Kypsis
@GregoryConrad
Comment options

@Kypsis
Comment options

@GregoryConrad
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants