Api / JavaScript /

register( object )

Make a object observable that can be listen for mutations.

Arguments

object Object

A POJO object.

Returns

A ES6 proxy object ready to be observed.

Examples

let user = dop.register({name: 'John'})
user.name // 'John'
let user = dop.register({name: 'John'})
let user2 = dop.register(user)
user === user2 // true
let user = dop.register({name: 'John'})
let user2 = dop.register({name: 'John'})
user === user2 // false
let userObject = {name: 'John'}
let user = dop.register(userObject)
user === userObject // false

See also