How to use the falcor.Model.error function in falcor

To help you get started, we’ve selected a few falcor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tivac / falcor-experiment / router / colorsById.js View on Github external
"use strict";

var Model  = require("falcor").Model,
    $error = Model.error,
    $atom  = Model.atom,
    $ref   = Model.ref,
    
    chunk  = require("./lib/chunk"),
    map    = require("./lib/map-ids"),
    fields = require("./lib/fields");

module.exports = [ {
    route : "colorsById[{integers:ids}].id",
    get   : function(pathset) {
        return pathset.ids.map(function(id) {
            return {
                path  : [ pathset[0], id, pathset[2] ],
                value : $atom(id)
            };
        });