How can I use the Trigger state in the Trigger rule?

The Daml docs say that

The rule depends on the following arguments:

  • The party your trigger is running as.
  • The user-defined state.

The autoReply example though doesn’t use the user-defined state.

Could you show me an example how the state can be used in the rule?

TriggerA s is an instance of ActionState s (TriggerA s) which provides you with get, put & modify for accessing and moyifying the state Module DA.Action.State.Class — Daml SDK 2.1.1 documentation.


Thank you, Moritz!