Skip to content

ObserveOptions

The options of ctx.observe. They state what the handler receives.

ctx.observe(ctx.keys.app.language, { old: true, new: true }, change => {
ctx.log('info', `The language changed from ${change.old} to ${change.new}`);
});
readonly initial?: boolean;

When true, the handler is called once, immediately, with the current value.


readonly new?: boolean;

When true, the change that the handler receives contains the new value.


readonly old?: boolean;

When true, the change that the handler receives contains the previous value.


readonly prior?: boolean;

When true, the handler is also called just before the change happens.