UNPKG

solidstate

Version:

An observable REST client for Javascript with a dramatically simple & fluent API.

30 lines (26 loc) 893 B
if (typeof define !== 'function') { var define = require('amdefine')(module); } define([ 'knockout', 'underscore', 'URIjs', 'when', 'zoetropic' ], function(ko, _, URI, when, z) { 'use strict'; var o = ko.observable, u = ko.utils.unwrapObservable, c = ko.computed, w = function(v) { return ko.isObservable(v) ? v : o(v); }; // Reference = Model -> Collection -> ko.observable // // A reference complements a Link. Since the link is from collection to // collection, the Reference knows how get the proper value out of the // destination collection and how to put it back. It may refer // to any piece of the model. // // A `Reference` is essentially the read/write _dereference_ spec. It may eventually // have more useful methods. var Reference = function(impl) { return impl; }; });