Skip to content

Type Interfaces : Combiner

johnmcclean-aol edited this page Nov 23, 2016 · 1 revision

The Combiner interface

A Combiner can be used to combine values inside wrapped types by applying a function. It is a lighter weight super-class of ApplicativeFunctor.

In cyclops-react it has the following methods

  • combine : lazily combines the current ApplicativeFunctor with another Value or Combiner/ ApplicativeFunctor type via a user supplied function

Examples

FutureW.ofSupplier(this::loadData,exec)
       .combine(Maybe.just(10),(a,b)->a+b))//asynchronously apply the adding function when loadData completes

Implementations

AnyMValue, ApplicativeFunctor, Eval, FeatureToggle, Ior<ST,PT>, Maybe, TransformerValue, Try<T,X>, Xor<ST,PT>

Clone this wiki locally