本文整理汇总了TypeScript中lodash.pullAt函数的典型用法代码示例。如果您正苦于以下问题:TypeScript pullAt函数的具体用法?TypeScript pullAt怎么用?TypeScript pullAt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pullAt函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: update
update(dt: number, now: number) {
if (this.transitionState === TransitionState.BetweenTransition && now > this.nextTransitionAt) {
console.log('next');
this.nextTransition();
}
if (this.transitionState === TransitionState.InTransition) {
if (this.interp > 1) {
console.log('exiting transition');
this.exitTransition(now);
} else {
this.interp += dt * interpSpeed;
}
}
if (now > this.lastSpawn + spawnMs) {
this.lastSpawn = now;
this.addLayer();
}
let idxsToSweep = [];
this.layers = this.layers.map((layer, idx) => {
const accel = layer.radius * accelFactor;
const radius = layer.radius + dt * speed * accel;
if (radius > maxRadius) {
idxsToSweep.push(idx);
}
return {
radius,
angle: layer.angle + dt * rotateSpeed,
};
});
_.pullAt(this.layers, idxsToSweep);
}
开发者ID:thomasboyt,项目名称:echoes-viz,代码行数:40,代码来源:state.ts
示例2:
_.times(len, (i) => {
r = _.random(len - 1 - i);
retArr.push(indexArr[r]);
_.pullAt(indexArr, r);
});
开发者ID:miluu,项目名称:createjs-tetris,代码行数:5,代码来源:index.ts
示例3: removeIngredient
public removeIngredient(index: number): void {
const ingredients = this.getCurrentIngredients();
pullAt(ingredients, index);
this.recipeForm.patchValue({ingredients});
}
开发者ID:tvsloot,项目名称:recipe-block,代码行数:5,代码来源:create-recipe.component.ts
示例4: parseInt
const dropUsers = count => {
count = parseInt(count)
const removeAt = _.uniq(_.times(count, () => _.random(0, users.length)))
_.pullAt(users, removeAt)
console.log('Removed ~', count, 'users')
}
开发者ID:alexsandrocruz,项目名称:botpress,代码行数:6,代码来源:seed.ts
示例5: withoutFaces
withoutFaces(faces: Face[]) {
const removed = [...this.solidData.faces];
_.pullAt(removed, _.map(faces, 'index'));
return this.withFaces(removed);
}
开发者ID:tessenate,项目名称:polyhedra-viewer,代码行数:5,代码来源:SolidBuilder.ts
注:本文中的lodash.pullAt函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论