@Component('test-watch')
export default class TestWatch extends DecoElement {
@Watch(['value'])
watchValue(val: number, oldValue: number, cleanup: () => void) {
console.log('watch value', val, oldValue);
cleanup();
}
@Watch(['value'], { once: true })
watchValueOnce(val: number, oldValue: number, cleanup: () => void) {
console.log('watch once value', val, oldValue);
}
@Watch(['value'], { immediate: true })
watchValueImmediate(val: number, oldValue: number, cleanup: () => void) {
console.log('watch value, immediate run', val, oldValue);
}
}