Edit This Page


Untracked allows you to run a piece of code without establishing observers. Like transaction, untracked is automatically applied by (@)action, so usually it makes more sense to use actions than to use untracked directly. Example:

const person = observable({
    firstName: "Michel",
    lastName: "Weststrate"

autorun(() => {
        // this untracked block will return the person's firstName without establishing a dependency
        untracked(() => person.firstName)
// prints: Weststrate, Michel

person.firstName = "G.K.";
// doesn't print!

person.lastName = "Chesterton";
// prints: Chesterton, G.K.