quickmodel / IQChange
Interface: IQChange<T>
Payload delivered to each observer callback whenever a model property changes.
Example
typescript
const user = new UserModel({ name: 'Alice', age: 30 });
user.$qSubscribe((change: IQChange) => {
console.log(change.field); // 'name'
console.log(change.prev); // 'Alice'
console.log(change.next); // 'Bob'
});
user.name = 'Bob';Type Parameters
T
T = unknown
Type of the property value that changed (defaults to unknown).
Properties
field
field:
string
Name of the field that changed. Matches the TypeScript property name declared in the model class.
next
next:
T
Value of the field after the change, after type transformation. This is the value that is now stored in the model.
prev
prev:
T
Value of the field before the change, after type transformation. For example, if the field is typed as Date, prev is already a Date instance (not the raw string that was assigned).