-
Notifications
You must be signed in to change notification settings - Fork 32
Events with return type #51
Comments
I've thought about return values before (obviously) and it just doesn't make sense. You can't chain a return value. Thus you can't really have multiple listeners returning a single value. The goal of the library is to increase composition - supporting return value methods just reduces it again. |
Hi I'm starting to use Navi and it would be great to have some kind of manipulation of events that needs a return value, I was thinking about passing between events the return value of the previous one, using the result value of the whole chain as the return value for the source event/method. If you don't want to change the value (the listener) on an event just result the previous one and if you want to change it you can do it and you can also take care about what returned the ones that were previous your listener call, so you can do composition with this. I imagine this on onCreateView, since the common case will be us controlling all the listeners, a common scenario would be having only one of the listeners returning something, but if we have two listeners for that, maybe the first will return a view and the second one could add another view to the created by the first or maybe wrapping the view created by the first listener with a new view. I hope my thoughts about this are easy to understand :) |
I've decided that, given that there are alternatives to Navi out there, I don't need Navi to be something for everyone. I very purposefully want to keep the library simple and focused. For my own needs, right now, listening works just fine. If you want return values, I suggest you check out https://github.com/passsy/CompositeAndroid. |
Activity#onRetainNonConfigurationInstance
was undeprecated in the AppCompat23.2.1
and it's time to add it into navi.Compared to all other events, this call requires a return value which breaks a lot of things. I couldn't get it to work without changing everything. Not sure how this should be handled.
Possible events to add:
Activity#onRetainNonConfigurationInstance
Events with return type #51Fragment#onCreateView
Should navi provide more than listening capabilities? #12#onCreateOptionsMenu
Options menu events #34#onPrepareOptionsMenu
Options menu events #34#onOptionsItemSelected
#onDestroyOptionsMenu
#onOptionsMenuClosed
Any new thoughts, other than no, @dlew?
The text was updated successfully, but these errors were encountered: