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


TypeScript MapLike.set方法代码示例

本文整理汇总了TypeScript中map-like.MapLike.set方法的典型用法代码示例。如果您正苦于以下问题:TypeScript MapLike.set方法的具体用法?TypeScript MapLike.set怎么用?TypeScript MapLike.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在map-like.MapLike的用法示例。


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

示例1: LogGroup

 const onBeginTransaction = (_payload: TransactionBeganPayload, meta: DispatcherPayloadMeta) => {
     if (!meta.transaction) {
         console.warn("meta.transaction is missing");
         return;
     }
     const logGroup = new LogGroup({ title: meta.transaction.name, isTransaction: true });
     this._transactionMap.set(meta.transaction.id, logGroup);
     // the logGroup is root
     this.currentLogBuffer.push(logGroup);
 };
开发者ID:almin,项目名称:almin,代码行数:10,代码来源:AsyncLogger.ts

示例2: finishedCallback

 dispatcher.onDispatch((payload, meta) => {
     if (payload instanceof DidExecutedPayload && meta.useCase && meta.isUseCaseFinished) {
         calledMap.set(meta.useCase.id, true);
         finishedCallback();
     } else if (payload instanceof CompletedPayload && meta.useCase && meta.isUseCaseFinished) {
         if (calledMap.has(meta.useCase.id)) {
             return void calledMap.delete(meta.useCase.id);
         }
         finishedCallback();
     }
     return;
 });
开发者ID:almin,项目名称:almin,代码行数:12,代码来源:DispatcherPayloadMeta-test.ts

示例3: deepEqual

 this.ruleNames.forEach(ruleName => {
     const rule = this.rules[ruleName];
     const ruleConfig = this.rulesConfig[ruleName];
     const savedConfigList = addedRuleMap.get(rule) || [];
     // same ruleCreator and ruleConfig
     const hasSameConfig = savedConfigList.some(savedConfig => {
         return deepEqual(savedConfig, ruleConfig, { strict: true });
     });
     if (hasSameConfig) {
         return;
     }
     newRawRules[ruleName] = rule;
     newRawRulesConfig[ruleName] = ruleConfig;
     // saved
     savedConfigList.push(ruleConfig);
     addedRuleMap.set(rule, savedConfigList);
 });
开发者ID:,项目名称:,代码行数:17,代码来源:

示例4: open

 /**
  * Begin transaction of the useCaseExecutor/UseCase
  */
 open(useCaseExecutor: UseCaseExecutor<any>) {
     const onDispatchOnUnitOfWork = (payload: Payload, meta: DispatcherPayloadMeta) => {
         // If unit of work is working as transaction, overwrite meta.transaction
         if (this.isTransactionWorking) {
             meta.transaction = {
                 id: this.id,
                 name: this.name
             };
         }
         // Notes: It is specific order for updating store logging
         // 1. Commit
         this.unitOfWork.addCommitment({
             payload,
             meta,
             debugId: this.id
         });
         // 2. Dispatch to Dispatcher
         this.dispatcher.dispatch(payload, meta);
     };
     const unsubscribe = useCaseExecutor.onDispatch(onDispatchOnUnitOfWork);
     this.unsubscribeMap.set(useCaseExecutor, unsubscribe);
 }
开发者ID:almin,项目名称:almin,代码行数:25,代码来源:UseCaseUnitOfWork.ts


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