Bind state into an endpoint
porcelain_state(..., .state = list(...))
Named arguments representing state to bind; see
Details
.
A list of named state to bind, instead
of using ...
- this interface is considerably easier to
program against if building an API programmatically, avoiding
the use of do.call
.
This method allows state to be bound to the target function. Each
element of ...
(or .state
) is named with the
argument to the target function being bound, and the value is the
value that argument will take. Once bound, the arguments to the
target function may not be provided by an input.
The primary use case for this is to bind mutable state (database connections, etc) that may be shared amongst different endpoints within an API.