multibind {injectoR} | R Documentation |
Aggregates multiple factories under one key
Description
Aggregates multiple factories under one key
Usage
multibind(key, scope = default, combine = function(this, parent)
base::c(this, parent), binder = .binder)
Arguments
key |
injectable bean identifier |
scope |
of the bean, wraps the injected factory call specifying provisioning strategy, if omitted a new bean instance will be provisioned each time injection is requested; injectoR also ships with with the singleton scope which will provide once and cache the bean for subsequent calls. Interface allows for custom scoping, the scope parameter must be a function accepting key (name) and the provider - the wrapped injected factory call - a function accepting no parameters responsible for actual provisioning |
combine |
aggregation procedure for combination of context and inherited values, a function accepting a list of injectable values from the current binder context and a no argument function to retrieve values of the parent context; if omitted will the binding will aggregate all values |
binder |
for this binding, if omitted the binding is added to the root binder |
Value
a function accepting one or more factories for adding elements to the binding; naming the factories will result in named values injected; optionally accepts a scope for the bindings, if omitted defaults to provide on injection; please be aware that the scope is called without key for unnamed multibinding
Examples
multibind ('keys', binder = binder ()) (function () 'skeleton')