WriteHookContext#

class brainstate.WriteHookContext(operation, state_ref, timestamp=time(), metadata=dict(), value=None, old_value=None)[source]#

Base context for write operations.

This context provides information about both the new value being written and the previous value that will be replaced.

value#

The new value being written to the state

Type:

Any

old_value#

The previous value before the write operation

Type:

Any