description: >
  A stash usage example

metadata:
  name: Stash

resources:
  mapping:
    type: 'Cybus::Mapping'
    properties:
      mappings:
        - subscribe:
            topic: "maschine/raw/temperature"
          publish:
            topic: "machine/enhanced/temperature"
          rules:
            - transform: 
                expression: |
                  {
                    "previous": $last("cache").current,
                    "current": current
                  }
            - stash:
                label: cache
