isReset is a function that identifies events with a special property: They reset the state to
some value that only depends on this specific event and the initial state. That
means no previous event has any bearing whatsoever on the state after the reset event has been
When an event appears where
true, then the Pond will first reset the state to
the initial state, and then apply the event.
When an event appears that is older than the most recent reset event, it is simply ignored, rather than causing time travel as it would normally do.
Suppose a stream of events recording the current value of something, like the temperature of a room. To get at the current value of the room, we write a very simple Fish:
isReset, we would lose a lot of performance due to
going through all historic events
time travelling when events occur out of order
isReset, we disregard historic events and avoid unneccessary time travel.