当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ember-metal._instrumentStart函数代码示例

本文整理汇总了TypeScript中ember-metal._instrumentStart函数的典型用法代码示例。如果您正苦于以下问题:TypeScript _instrumentStart函数的具体用法?TypeScript _instrumentStart怎么用?TypeScript _instrumentStart使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_instrumentStart函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: update

  update(bucket: ComponentStateBucket): void {
    let { component, args, argsRevision, environment } = bucket;

    if (DEBUG) {
       this._pushToDebugStack(component._debugContainerKey, environment);
    }

    bucket.finalizer = _instrumentStart('render.component', rerenderInstrumentDetails, component);

    if (!args.tag.validate(argsRevision)) {
      let props = processComponentArgs(args);

      bucket.argsRevision = args.tag.value();

      component[IS_DISPATCHING_ATTRS] = true;
      component.setProperties(props);
      component[IS_DISPATCHING_ATTRS] = false;

      component.trigger('didUpdateAttrs');
      component.trigger('didReceiveAttrs');
    }

    if (environment.isInteractive) {
      component.trigger('willUpdate');
      component.trigger('willRender');
    }
  }
开发者ID:fpauser,项目名称:ember.js,代码行数:27,代码来源:curly.ts

示例2: create

  create(
    environment: Environment,
    _state: DefinitionState,
    _args: Arguments | null,
    dynamicScope: DynamicScope
  ) {
    let component = this.component;

    if (DEBUG) {
      this._pushToDebugStack((component as any)._debugContainerKey, environment);
    }

    let finalizer = _instrumentStart('render.component', initialRenderInstrumentDetails, component);

    dynamicScope.view = component;

    // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components
    if (component.tagName === '') {
      if (environment.isInteractive) {
        component.trigger('willRender');
      }

      component._transitionTo('hasElement');

      if (environment.isInteractive) {
        component.trigger('willInsertElement');
      }
    }

    if (DEBUG) {
      processComponentInitializationAssertions(component, {});
    }

    return new ComponentStateBucket(environment, component, null, finalizer);
  }
开发者ID:jrjohnson,项目名称:ember.js,代码行数:35,代码来源:root.ts

示例3: create

  create(environment: Environment, definition: CurlyComponentDefinition, args: Arguments, dynamicScope: DynamicScope, callerSelfRef: VersionedPathReference<Opaque>, hasBlock: boolean): ComponentStateBucket {
    if (DEBUG) {
      this._pushToDebugStack(`component:${definition.name}`, environment);
    }

    let parentView = dynamicScope.view;

    let factory = definition.ComponentClass;

    let capturedArgs = args.named.capture();
    let props = processComponentArgs(capturedArgs);

    aliasIdToElementId(args, props);

    props.parentView = parentView;
    props[HAS_BLOCK] = hasBlock;

    props._targetObject = callerSelfRef.value();

    let component = factory.create(props);

    let finalizer = _instrumentStart('render.component', initialRenderInstrumentDetails, component);

    dynamicScope.view = component;

    if (parentView !== null && parentView !== undefined) {
      parentView.appendChild(component);
    }

    // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components
    if (component.tagName === '') {
      if (environment.isInteractive) {
        component.trigger('willRender');
      }

      component._transitionTo('hasElement');

      if (environment.isInteractive) {
        component.trigger('willInsertElement');
      }
    }

    let bucket = new ComponentStateBucket(environment, component, capturedArgs, finalizer);

    if (args.named.has('class')) {
      bucket.classRef = args.named.get('class');
    }

    if (DEBUG) {
      processComponentInitializationAssertions(component, props);
    }

    if (environment.isInteractive && component.tagName !== '') {
      component.trigger('willRender');
    }

    return bucket;
  }
开发者ID:fpauser,项目名称:ember.js,代码行数:58,代码来源:curly.ts

示例4: getComponentDefinition

 getComponentDefinition(name: string, { owner, moduleName }: any): ComponentDefinition<Opaque> {
   let finalizer = _instrumentStart('render.getComponentDefinition', instrumentationPayload, name);
   let source = moduleName && `template:${moduleName}`;
   let definition = this._definitionCache.get({ name, source, owner });
   finalizer();
   // TODO the glimmer-vm wants this to always have a def
   // but internally we need it to sometimes be undefined
   return definition!;
 }
开发者ID:fpauser,项目名称:ember.js,代码行数:9,代码来源:environment.ts

示例5: instrument

 instrument() {
   this.finalizer = _instrumentStart('render.outlet', instrumentationPayload, this.outletState);
 }
开发者ID:fpauser,项目名称:ember.js,代码行数:3,代码来源:outlet.ts


注:本文中的ember-metal._instrumentStart函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。