src/Binding.js
function (subpath) {
    var pathAsArray = asArrayPath(subpath);
    var absolutePath = Util.joinPaths(this._path, pathAsArray);
    if (absolutePath.length > 0) {
      var absolutePathAsString = asStringPath(absolutePath);
      var cached = this._sharedInternals.cache[absolutePathAsString];

      if (cached) {
        return cached;
      } else {
        var subBinding = new Binding(absolutePath, this._sharedInternals);
        this._sharedInternals.cache[absolutePathAsString] = subBinding;
        return subBinding;
      }
    } else {
      return this;
    }
  }
function (subpath) {
    var pathAsArray = asArrayPath(subpath);
    var absolutePath = Util.joinPaths(this._path, pathAsArray);
    if (absolutePath.length > 0) {
      var absolutePathAsString = asStringPath(absolutePath);
      var cached = this._sharedInternals.cache[absolutePathAsString];

      if (cached) {
        return cached;
      } else {
        var subBinding = new Binding(absolutePath, this._sharedInternals);
        this._sharedInternals.cache[absolutePathAsString] = subBinding;
        return subBinding;
      }
    } else {
      return this;
    }
  }
function ( subpath ) { var pathAsArray = asArrayPath ( subpath ) ; var absolutePath = Util . joinPaths ( this . _path , pathAsArray ) ; if ( absolutePath . length > 0 ) { var absolutePathAsString = asStringPath ( absolutePath ) ; var cached = this . _sharedInternals . cache [ absolutePathAsString ] ; if ( cached ) { return cached ; } else { var subBinding = new Binding ( absolutePath , this . _sharedInternals ) ; this . _sharedInternals . cache [ absolutePathAsString ] = subBinding ; return subBinding ; } } else { return this ; } }
Bind to subpath. Both bindings share the same backing value. Changes are mutually visible.
@param {String|Array} [subpath] subpath as a dot-separated string or an array of strings and numbers
@return {Binding} new binding instance, original is unaffected
Bind to subpath . Both bindings share the same backing value . Changes are mutually visible .