$isDirty()
Usage
class User extends Model { static entity = 'users' @Attr('') declare id: number @Str('') declare name: string}const user = new User({ id: 1, name: 'John Doe' })// Returns falseuser.$isDirty()user.name = 'Jane Doe'// Returns trueuser.$isDirty()// Returns trueuser.$isDirty('name')// Returns falseuser.$isDirty('id')// Throws an error because you are checking a not existing attribute of `User`user.$isDirty('lastName')
Typescript Declarations
function $isDirty($attribute?: keyof ModelFields): Boolean
Table of Contents