Skip to content

Instantly share code, notes, and snippets.

@ChrisCates
Created September 25, 2015 05:40
Show Gist options
  • Save ChrisCates/a0117954983e5b4fefb2 to your computer and use it in GitHub Desktop.
Save ChrisCates/a0117954983e5b4fefb2 to your computer and use it in GitHub Desktop.
<!-- index.html -->
<html>
<head>
<!-- Do _not_ rely on this URL in production. Use only during development. -->
<script src="falcor.browser.js"></script>
<script>
$ref = falcor.ref;
var model = new falcor.Model();
model.set({
paths: [
["todos", [12,15], ["name","done"]]
],
jsonGraph: {
todos: [
$ref("todosById[12]"),
$ref("todosById[15]")
],
todosById: {
12: {
name: "go to the ATM",
done: false
},
15: {
name: "buy milk",
done: false
}
}
},
}).then(function(jsonEnvelope) {
console.log(JSON.stringify(jsonEnvelope, null, 4));
});
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment