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


TypeScript sift.default函数代码示例

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


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

示例1: sift

export const get: Operation = (req, res) => {

    const services = Service.all().map(service => {

        const ret: any = service.export();
        ret.hasLogoData = service.hasLogoData;

        return ret;
    });

    api.responseJSON(res, sift(req.query, services));
};
开发者ID:tosono,项目名称:Mirakurun,代码行数:12,代码来源:services.ts

示例2: getOrder

export const get: Operation = (req, res) => {

    const services = Service.all().map(service => {

        const ret: any = service.export();
        ret.hasLogoData = service.hasLogoData;

        return ret;
    });

    services.sort((a: ServiceItem, b: ServiceItem) => getOrder(a) - getOrder(b));

    api.responseJSON(res, sift(req.query, services));
};
开发者ID:kanreisa,项目名称:Mirakurun,代码行数:14,代码来源:services.ts

示例3: loadItem

  async loadItem(query: any): Promise<T|undefined> {
    const test = sift(query) as any;
    const loaded = this.find((model) => test(model.source));
    if (loaded) return loaded;
    
    const { value, done } = await readOneChunk<any>(this._bus.dispatch(new DSFindRequest(this.collectionName, query, false)));

    // item exists, so add and return it. Otherwise return undefined indicating
    // that the item does not exist.
    if (value) {
      const item = this.createActiveRecord(value);
      this.push(item);
      return item;
    }
  }
开发者ID:cryptobuks,项目名称:tandem,代码行数:15,代码来源:collection.ts

示例4: sift

export const get: Operation = (req, res) => {

    const channels = Channel.all().map(channel => {

        const ch: any = channel.export();

        ch.services = channel.getServices().map(service => ({
            id: service.id,
            serviceId: service.serviceId,
            networkId: service.networkId,
            name: service.name
        }));

        return ch;
    });

    api.responseJSON(res, sift(req.query, channels));
};
开发者ID:tosono,项目名称:Mirakurun,代码行数:18,代码来源:channels.ts

示例5: FilterBus

 this._globalMessageObserver = new FilterBus((message: PostDSMessage) => {
   return (message.type === DSUpdateRequest.DS_UPDATE || message.type === DSInsertRequest.DS_INSERT || message.type === PostDSMessage.DS_DID_UPDATE || message.type === PostDSMessage.DS_DID_INSERT) && message.collectionName === this.collectionName && sift(this.query)(message.data);
 }, new CallbackBus(this.onPostDSMessage.bind(this)));
开发者ID:cryptobuks,项目名称:tandem,代码行数:3,代码来源:collection.ts


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