robospice icon indicating copy to clipboard operation
robospice copied to clipboard

Add "execute" method which could get Lambdas.

Open georgeci opened this issue 9 years ago • 6 comments

As:

getSpiceManager().execute(request, response -> someWork(response), spiceException -> onError(spiceException ));

georgeci avatar Jul 16 '15 13:07 georgeci

Lambdas are not yet supported in Android.

nkeskinov avatar Jul 16 '15 13:07 nkeskinov

https://github.com/evant/gradle-retrolambda I use lambdas in my Android project. I can do pull-request with this, but not soon.

georgeci avatar Jul 16 '15 13:07 georgeci

That would (not too necessarily) add a dependency to another project/plugin. Developers who use lambdas may always extend their SpiceManager to include a lambda construct like you proposed. Also, RoboSpice is very open for contributors and this is a fine case for creating an extension.

nkeskinov avatar Jul 16 '15 14:07 nkeskinov

I wrote it but I thought that to have the opportunity out of the box is good idea https://gist.github.com/georgeci/4229e8142f6ff6306521

georgeci avatar Jul 16 '15 14:07 georgeci

Nice! I would still suggest doing an extension as lambdas are not the most standard constructs in Android and using them does not add anything to the core behavior of RoboSpice. Reopened the issue so that we can have anyone else's feedback.

nkeskinov avatar Jul 16 '15 14:07 nkeskinov

Hi guys, I agree it would be a nice addition. Extensions in RS are designed for this kind of things.. (I say this to reconciliate @nkeskinov concern of not adding this to the core and still adding the feature). In that case, how could we make it so that this extension can be combined with any others ? (without having to double every single module).

I am sorry not to be very active. But still, I got ideas to extend RS but don't have time to work on that now.

stephanenicolas avatar Jul 17 '15 04:07 stephanenicolas