How to use @glimmer/validator - 10 common examples

To help you get started, we’ve selected a few @glimmer/validator 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 / integration-tests / lib / components / emberish-glimmer.ts View on Github external
getTag({ args: { tag }, component }: EmberishGlimmerComponentState): Tag {
    return combine([tag, getSelf(component).tag]);
  }
github glimmerjs / glimmer-vm / packages / @glimmer / runtime / lib / compiled / opcodes / dom.ts View on Github external
constructor(
    public tag: Tag,
    private manager: InternalModifierManager,
    private modifier: ModifierInstanceState
  ) {
    super();
    this.lastUpdated = value(tag);
  }
github glimmerjs / glimmer-vm / packages / @glimmer / runtime / lib / compiled / opcodes / dom.ts View on Github external
evaluate(vm: UpdatingVM) {
    let { manager, modifier, tag, lastUpdated } = this;

    if (!validate(tag, lastUpdated)) {
      vm.env.scheduleUpdateModifier(modifier, manager);
      this.lastUpdated = value(tag);
    }
  }
}
github glimmerjs / glimmer-vm / packages / @glimmer / runtime / lib / compiled / opcodes / dom.ts View on Github external
evaluate(vm: UpdatingVM) {
    let { attribute, reference, tag } = this;
    if (!validate(tag, this.lastRevision)) {
      attribute.update(reference.value(), vm.env);
      this.lastRevision = value(tag);
    }
  }
}
github glimmerjs / glimmer-vm / packages / @glimmer / runtime / lib / compiled / opcodes / dom.ts View on Github external
constructor(private reference: VersionedReference, private attribute: DynamicAttribute) {
    super();
    let { tag } = reference;
    this.tag = tag;
    this.lastRevision = value(tag);
  }
github glimmerjs / glimmer-vm / packages / @glimmer / reference / lib / state.ts View on Github external
update(value: T) {
    let { inner } = this;

    if (value !== inner) {
      dirty(this.tag);
      this.inner = value;
    }
  }
github glimmerjs / glimmer-vm / packages / @glimmer / reference / lib / state.ts View on Github external
forceUpdate(value: T) {
    dirty(this.tag);
    this.inner = value;
  }
github glimmerjs / glimmer-vm / packages / @glimmer / runtime / lib / compiled / opcodes / dom.ts View on Github external
APPEND_OPCODES.add(Op.DynamicAttr, (vm, { op1: _name, op2: trusting, op3: _namespace }) => {
  let name = vm[CONSTANTS].getString(_name);
  let reference = check(vm.stack.pop(), CheckReference);
  let value = reference.value();
  let namespace = _namespace ? vm[CONSTANTS].getString(_namespace) : null;

  let attribute = vm.elements().setDynamicAttribute(name, value, !!trusting, namespace);

  if (!isConst(reference)) {
    vm.updateWith(new UpdateDynamicAttributeOpcode(reference, attribute));
  }
});
github glimmerjs / glimmer-vm / packages / @glimmer / runtime / lib / compiled / opcodes / dom.ts View on Github external
APPEND_OPCODES.add(Op.PushRemoteElement, vm => {
  let elementRef = check(vm.stack.pop(), CheckReference);
  let insertBeforeRef = check(vm.stack.pop(), CheckReference);
  let guidRef = check(vm.stack.pop(), CheckReference);

  let element: SimpleElement;
  let insertBefore: Maybe;
  let guid = guidRef.value() as string;

  if (isConst(elementRef)) {
    element = check(elementRef.value(), CheckElement);
  } else {
    let cache = new ReferenceCache(elementRef as Reference);
    element = check(cache.peek(), CheckElement);
    vm.updateWith(new Assert(cache));
  }

  if (insertBeforeRef.value() !== undefined) {
    if (isConst(insertBeforeRef)) {
      insertBefore = check(insertBeforeRef.value(), CheckOption(CheckNode));
    } else {
      let cache = new ReferenceCache(insertBeforeRef as Reference>);
      insertBefore = check(cache.peek(), CheckOption(CheckNode));
      vm.updateWith(new Assert(cache));
    }
  }

@glimmer/validator

Objects used to track values and their dirtiness in Glimmer

MIT
Latest version published 2 months ago

Package Health Score

89 / 100
Full package analysis

Similar packages