EroticDungeonGame/node_modules/rxjs/dist/esm/internal/operators/find.js
3944Realms 8c4ce2709c fix(兼容emotescraft和rideeverything): 修改骑乘逻辑和tick取消EmtoesCraft表情
使用Mixin中检测绕过骑乘取消和开始骑乘逻辑,避免原版的unRide方法导致非预期的退出设备;在每tick检测,如果在设备上则停止表情动画
2026-02-20 14:45:57 +08:00

22 lines
807 B
JavaScript

import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
export function find(predicate, thisArg) {
return operate(createFind(predicate, thisArg, 'value'));
}
export function createFind(predicate, thisArg, emit) {
const findIndex = emit === 'index';
return (source, subscriber) => {
let index = 0;
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
const i = index++;
if (predicate.call(thisArg, value, i, source)) {
subscriber.next(findIndex ? i : value);
subscriber.complete();
}
}, () => {
subscriber.next(findIndex ? -1 : undefined);
subscriber.complete();
}));
};
}
//# sourceMappingURL=find.js.map