Skip to content

How to track reactive functions? #145

Closed
@rickmed

Description

Considering the following example:

var data = observable({
   numbers: [1,2,3],
   sum: () => data.numbers.reduce((a, b) => a + b, 0)
});

var disposer = autorun(() => console.log(data.sum));

How would I track all the functions that depend on when an observed object property is mutated?

I'm thinking on building debugging tools equivalent to https://github.com/mobxjs/mobx-react-devtools but not for react components.

So when a property is mutated on an observed object, you would log all the reactive functions that where called.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions