Aardwolf-Social / aardwolf

Powering connected social communities with open software.
GNU Affero General Public License v3.0
480 stars 40 forks source link

Create a way to export variables bound in perform! macro #191

Closed asonix closed 5 years ago

asonix commented 5 years ago

The perform macro returns a Future or Result where the success type is the last variable bound in the operation list. This means that any intermediate state is lost. This PR provides a way to export the intermediate state from perform!.

Example:

perform!(state3, CurrentActorError, [
    (persona = FetchPersona(id)),
    (base_actor = FetchBaseActor(persona.id())),
    (_ = ExportKind(CurrentActor(base_actor, persona))),
])

This saves the intermediate state persona in the output of the macro