Skip to content

MST integration - views #28

Description

@Baael

Is there any way to observe computed values / views from MST?
like

const Store = types.model({
  nodes: types.array(Node)
})
.views(self => ({
  get activeNodes() {
    return self.nodes.filter( node => node.isActive )
  }
}))

const App = () => (
  <div>
    { map(store.activeNodes, node => <SomeComponent node={node} />) }
  </div>
)

render(App, document.body);

It seems it is not obtaining administration from it.

[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, 
in: 'Reaction[Autorun@8017]' TypeError: Cannot read property 'atom' of undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions