Api / JavaScript /

Observer.pause()

Pause the collector and won't store more mutations until it resumes.

Arguments

Returns

Examples

let user = dop.register({surname: 'Doe'})
let collector = dop.collect()
user.surname = 'Gonzalez'
collector.pause()
user.name = 'Josema' // This won't be collected
collector.resume()
user.name = 'Enzo'
console.log(collector.mutations.length) // 2

See also