How to use the @glimmer/runtime.curry function in @glimmer/runtime

To help you get started, we’ve selected a few @glimmer/runtime 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 / test-helpers / lib / environment / modes / lazy / register.ts View on Github external
export function componentHelper(
  resolver: LazyRuntimeResolver,
  registry: JitRegistry,
  name: string
): Option {
  let handle = registry.lookupComponentHandle(name);

  if (handle === null) return null;

  let spec = resolver.resolve(handle);
  return curry(spec);
}
github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / environment.ts View on Github external
componentHelper(name: string, meta: TemplateMeta): Option {
    let specifier = this.resolver.lookupComponent(name, meta);

    if (!specifier) return null;

    let spec = this.resolver.resolve(specifier);
    return curry(spec);
  }
github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / environment / lazy-env.ts View on Github external
componentHelper(name: string): Option {
    let handle = this.resolver.lookupComponentHandle(name);

    if (handle === null) return null;

    let spec = this.resolver.resolve(handle);
    return curry(spec);
  }
github glimmerjs / glimmer-vm / packages / @glimmer / integration-tests / lib / modes / jit / register.ts View on Github external
export function componentHelper(
  resolver: TestJitRuntimeResolver,
  registry: TestJitRegistry,
  name: string
): Option {
  let handle = registry.lookupComponentHandle(name);

  if (handle === null) return null;

  let spec = resolver.resolve(handle);
  return curry(spec);
}
github glimmerjs / glimmer-vm / packages / @glimmer / test-helpers / lib / environment / modes / lazy / environment.ts View on Github external
componentHelper(name: string): Option {
    let handle = this.resolver.lookupComponentHandle(name);

    if (handle === null) return null;

    let spec = this.resolver.resolve(handle);
    return curry(spec);
  }
github emberjs / ember.js / packages / @ember / -internals / glimmer / lib / syntax / outlet.ts View on Github external
value(): CurriedComponentDefinition | null {
    let state = stateFor(this.outletRef);
    if (validate(state, this.lastState)) {
      return this.definition;
    }
    this.lastState = state;
    let definition = null;
    if (state !== null) {
      definition = curry(new OutletComponentDefinition(state), this.args);
    }
    return (this.definition = definition);
  }
github emberjs / ember.js / packages / ember-glimmer / lib / helpers / outlet.ts View on Github external
value(): CurriedComponentDefinition | null {
    let state = stateFor(this.outletRef);
    if (validate(state, this.lastState)) {
      return this.definition;
    }
    this.lastState = state;
    let definition = null;
    if (state !== null) {
      definition = curry(new OutletComponentDefinition(state));
    }
    return this.definition = definition;
  }
github emberjs / ember.js / packages / @ember / -internals / glimmer / lib / syntax / mount.ts View on Github external
if (typeof name === 'string') {
      if (this._lastName === name) {
        return this._lastDef;
      }

      assert(
        `You used \`{{mount '${name}'}}\`, but the engine '${name}' can not be found.`,
        env.owner.hasRegistration(`engine:${name}`)
      );

      if (!env.owner.hasRegistration(`engine:${name}`)) {
        return null;
      }

      this._lastName = name;
      this._lastDef = curry(new MountDefinition(name), args);

      return this._lastDef;
    } else {
      assert(
        `Invalid engine name '${name}' specified, engine name must be either a string, null or undefined.`,
        name === null || name === undefined
      );
      this._lastDef = null;
      this._lastName = null;
      return null;
    }
  }