How to use the @glimmer/util.keys 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 / integration-tests / lib / components / emberish-curly.ts View on Github external
static create(args: { attrs: Attrs }): EmberishCurlyComponent {
    let c = new this();

    for (let key of keys(args)) {
      c[key] = args[key];
    }

    return c;
  }
github glimmerjs / glimmer-vm / packages / @glimmer / integration-tests / lib / components / emberish-curly.ts View on Github external
setProperties(dict: Dict) {
    for (let key of keys(dict)) {
      (this as Dict)[key] = dict[key];
    }

    SELF_REF.get(this)!.dirty();
    this.dirtinessTag.inner.dirty();
  }
github glimmerjs / glimmer-vm / packages / @glimmer / integration-tests / lib / components / emberish-glimmer.ts View on Github external
static create({ attrs: args }: EmberishGlimmerArgs): EmberishGlimmerComponent {
    let c = new this({ attrs: args });

    for (let key of keys(args)) {
      (c as any)[key] = args[key];
    }

    return c;
  }
github glimmerjs / glimmer-vm / packages / @glimmer / integration-tests / lib / test-helpers / module.ts View on Github external
function nestedComponentModules(
  klass: RenderTestConstructor,
  tests: ComponentTests
): void {
  keys(tests).forEach(type => {
    let formattedType = `${type[0].toUpperCase() + type.slice(1)}`;
    QUnit.module(`[integration] ${formattedType}`, () => {
      for (let i = tests[type].length - 1; i >= 0; i--) {
        let t = tests[type][i];
        t(formattedType, klass);
        tests[type].pop();
      }
    });
  });
}
github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / hbs / builder.ts View on Github external
export function hash(map: { [key: string]: Expression }): Hash {
  let out: HashPair[] = [];

  for (let key of keys(map)) {
    out.push({ key: key as string, value: map[key] });
  }

  return { pairs: out };
}