-
Notifications
You must be signed in to change notification settings - Fork 58
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
API: add path support (navigation) #352
Conversation
Thanks for opening this pull request! Someone will review it soon 🔍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @ottodevs, the main thing is how we handle the path requests and changes.
Let me know if it's confusing and we can discuss in more detail :).
@@ -81,6 +77,9 @@ function AragonApi({ | |||
|
|||
// network | |||
api.network().subscribe(network => setNetwork(network || null)), | |||
|
|||
// path | |||
api.path().subscribe(path => setPath(path)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does a default value make sense here? Like a ''
or '/'
?
@ottodevs I've done a few things to this PR:
In particular, clients should now respond to I've also started on a self isolated context for each app (AppContext), to hold observables and state that is not relevant for any other app or a client (see #361 (comment)). |
@bpierre I've also thought about if it made sense to pass along more than a string; perhaps we can pass a string and an optional object that contains client-specific behaviour. Ideally asking to navigate to something like the email notifications would be more robust than harding coding the client's preferences query string into the path request. But we can do this on a second iteration since this change would be backwards compatible with the current API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 💥
Changes
Added request handler to the wrapper, then handle path from there and finally connect API and slightly modify API-react to use this new handler from the observable
If you are modifying the external API of one of the modules, please remember to also change the documentation
Pending docs until some approval feedback / polish
TBD