Stefan Vizzari
Stefan Vizzari

Reputation: 21

Using falcor to retrieve the value of a "node" rather than a "leaf"

For example, with the following code, I can retrieve a value for "leaf" c from a Falcor model

var model = new falcor.Model({ cache: { a: { b: { c: 'hi!'}}} })
model.getValue('a.b.c').then(val => console.log(val));

However, I'm interested in how to retrieve "node" b, i.e. so that the resulting json is { c: 'hi!' }.

Any help appreciated.

Upvotes: 2

Views: 118

Answers (1)

atoy
atoy

Reputation: 111

you can do this is by storing "c"as a jsongraph atom into b.

Upvotes: 1

Related Questions