Skip to content
This repository has been archived by the owner on May 23, 2020. It is now read-only.

Events with return type #51

Closed
passsy opened this issue Apr 21, 2016 · 3 comments
Closed

Events with return type #51

passsy opened this issue Apr 21, 2016 · 3 comments

Comments

@passsy
Copy link
Contributor

passsy commented Apr 21, 2016

Activity#onRetainNonConfigurationInstance was undeprecated in the AppCompat 23.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:

Any new thoughts, other than no, @dlew?

@passsy passsy changed the title Activity#onRetainNonConfigurationInstance Events with return type Apr 22, 2016
@dlew
Copy link
Contributor

dlew commented Apr 22, 2016

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.

@darrillaga
Copy link

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 :)

@dlew
Copy link
Contributor

dlew commented May 11, 2016

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.

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

3 participants