本文整理汇总了TypeScript中lodash/filter.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: sync
sync(activities: TActivity[]) {
const
existingActivities: TActivityViewModel[] = this.list.getValue(),
deletedActivities = __filter(
existingActivities,
viewModel => __every(activities, activity => this.areNotEqual(activity, viewModel))),
addedActivities = __filter(
activities,
activity => __every(existingActivities, viewModel => this.areNotEqual(activity, viewModel))),
updatedActivities = __filter(
existingActivities,
viewModel => __some<TActivity>(activities, activity => this.areEqual(activity, viewModel))),
addedViewModels = __map(addedActivities, this.mapper),
finder = (viewModel: TActivityViewModel) => __find(activities, activity => this.areEqual(activity, viewModel));
__each(deletedActivities, viewModel => this.list.remove(viewModel));
__each(addedViewModels, viewModel => {
viewModel.updateFrom(finder(viewModel));
this.list.add(viewModel);
});
__each(updatedActivities, viewModel => viewModel.updateFrom(finder(viewModel)));
}
开发者ID:guryanovev,项目名称:CrystalQuartz,代码行数:27,代码来源:activities-synschronizer.ts
示例2: boolHelper
function boolHelper(val, operator){
const isArr = isArray(val)
if (isArr) {
// Remove empty filters
val = filter(val, f => !isEmpty(f))
if (isArr && val.length === 1) {
return val[0]
} else if (isArr && val.length === 0) {
return {}
} else if (isArr
&& (operator == "must" || operator == "should")
&& (findIndex(val, isBoolOp.bind(null, operator)) != -1)) {
val = flattenBool(operator, val)
}
}
return {
bool:{
[operator]:val
}
}
}
开发者ID:BenJamesbabala,项目名称:searchkit,代码行数:21,代码来源:BoolQueries.ts
示例3: filter
getActiveAccessors(){
return filter(this.accessors, {active:true})
}
开发者ID:Eric013,项目名称:searchkit,代码行数:3,代码来源:AccessorManager.ts
示例4: filter
filterG(games: GameWithTeams[]){
const fs = this.filterService
const bs = this.betService
return filter(games, function(g){ return fs.filterGL(g, bs) })
}
开发者ID:idot,项目名称:betterplay,代码行数:5,代码来源:games.component.ts
注:本文中的lodash/filter.default函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论