IModelAction <T>
Type parameters
- T: UnknownModule
Index
Methods
filter
Whether this action handles the given diff. Typically a check on the diff's node, field, and action.
Parameters
diff: Diff
Returns boolean
handle
Declares the resources this diff calls for.
Parameters
diff: Diff
The diff that passed IModelAction.filter.
actionInputs: EnhancedModuleSchema<T>
The module's inputs, metadata, and the nodes it produced.
actionOutputs: ActionOutputs
The resources declared so far by earlier actions in this transaction.
Returns Promise<ActionOutputs>
actionOutputs, with this action's resources added.
A model action translates a change in intent into resources.
Octo diffs your models, and for every Diff it produces it asks each registered action whether the diff is its concern. The actions that accept it declare the resources that change has to bring about. This is the only place a model becomes infrastructure.
Register the class with Action, and a Factory to construct it.
Models
Definition of Actions.