本文整理汇总了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);
}
示例2:
_.times(len, (i) => {
r = _.random(len - 1 - i);
retArr.push(indexArr[r]);
_.pullAt(indexArr, r);
});
示例3: removeIngredient
public removeIngredient(index: number): void {
const ingredients = this.getCurrentIngredients();
pullAt(ingredients, index);
this.recipeForm.patchValue({ingredients});
}
示例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')
}
示例5: withoutFaces
withoutFaces(faces: Face[]) {
const removed = [...this.solidData.faces];
_.pullAt(removed, _.map(faces, 'index'));
return this.withFaces(removed);
}