How to use the @glimmer/util.isDict function in @glimmer/util

To help you get started, we’ve selected a few @glimmer/util 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 glimmerjs / glimmer-vm / packages / @glimmer / reference / lib / property.ts View on Github external
value(): unknown {
    let { _parentValue } = this;
    if (isDict(_parentValue)) {
      let old = pushTrackFrame();
      let ret = _parentValue[this._propertyKey];
      let tag = popTrackFrame(old);
      this.tag.inner.update(tag);
      return ret;
    } else {
      return undefined;
    }
  }
github glimmerjs / glimmer.js / packages / @glimmer / application / src / iterable.ts View on Github external
      keyFor = (item: unknown) => (isDict(item) ? item[keyPath] : item);
      break;
github glimmerjs / glimmer-vm / packages / @glimmer / reference / lib / property.ts View on Github external
export function data(value: unknown): VersionedPathReference {
  if (isDict(value)) {
    return new RootReference(value);
  } else {
    return new PrimitiveReference(value as null | undefined);
  }
}
github glimmerjs / glimmer-vm / packages / @glimmer / reference / lib / property.ts View on Github external
value() {
    let { _parentReference, _parentObjectTag, _propertyKey } = this;

    let parentValue = _parentReference.value();

    _parentObjectTag.inner.update(tagFor(parentValue, _propertyKey));

    if (isDict(parentValue)) {
      let old = pushTrackFrame();
      let ret = parentValue[_propertyKey];
      let tag = popTrackFrame(old);
      _parentObjectTag.inner.update(tag);
      return ret;
    } else {
      return undefined;
    }
  }