position | 0 | 13 | 56 | 120 |
---|---|---|---|---|
stream | 1 | 2 | 1 | 3 |
event | CardIssued | CardIssued | CardBlocked | CardIssued |
payload | 0x2423 | 0x2423 | 0x2423 | 0x2423 |
position | 0 | 16 | 32 | 48 |
---|---|---|---|---|
stream-hash (4) | 1 | 2 | 1 | 3 |
stream-version (4) | 1 | 1 | 2 | 1 |
log-position (8) | 0 | 13 | 56 | 120 |
Counting all the active cards
fromAll().
when({
$init: function() { return {counter: 0}; },
CardIssued: function(s,e) { s.counter += 1; },
CardBlocked: function(s,e) { s.counter -= 1; },
});
If we had a list of commands: c1, c2, c3, c4