constructor<T>(data: T)
View sourceCreates an event record around data.
Construction stores only the supplied value. To make a payload readable
from an Events resource, pass it to Events#write.
Class
Represents one typed event payload as an event record.
Constructing the record stores the supplied value without queuing or
publishing it. Use Events and Events#write when the
payload should be queued for event readers.
import { CEvent } from '@wimaengine/event'
const payload = { amount: 10 }
const event = new CEvent(payload)
console.log(event.data === payload) // true
console.log(event.data.amount) // 10constructor<T>(data: T)Creates an event record around data.
Construction stores only the supplied value. To make a payload readable
from an Events resource, pass it to Events#write.
The original typed payload stored in this event record.
The value is stored by reference without cloning or freezing. Reassigning this public field changes the payload exposed by the wrapper.