You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this would make a better API in terms of composing several navigators.
It would be more natural to do something like this:
classTopNavigator(privatevalchildNavigator:Navigator) : Navigator {
funapplyCommand(command:Command): Boolean {
if (childNavigator.applyCommand(command)) {
// child has handled this command, great!
} else {
handleCommandInTopNavigator()
}
}
With the current implementation returning "void" it is not simple to write above logic, you'd have to resort to some "hacky" ways.
If you are not against this suggestion, I could prepare a PR.
The text was updated successfully, but these errors were encountered:
dimsuz
changed the title
Make 'applyCommand' return boolean to indicate if command was recognized
Make 'Navigator.applyCommand()' return boolean to indicate if command was recognized
Oct 26, 2017
I believe this would make a better API in terms of composing several navigators.
It would be more natural to do something like this:
With the current implementation returning "void" it is not simple to write above logic, you'd have to resort to some "hacky" ways.
If you are not against this suggestion, I could prepare a PR.
The text was updated successfully, but these errors were encountered: