dist/async-iterable/operators.js
/** Play unique items from a set */
Play unique items from a set
Play unique items from a set
function distinct(it) {
    return __asyncGenerator(this, arguments, function* distinct_1() {
        var e_24, _a;
        const resultSet = new Set();
        try {
            for (var it_5 = __asyncValues(it), it_5_1; it_5_1 = yield __await(it_5.next()), !it_5_1.done;) {
                const item = it_5_1.value;
                if (!resultSet.has(item)) {
                    resultSet.add(item);
                    yield yield __await(item);
                }
            }
        }
        catch (e_24_1) { e_24 = { error: e_24_1 }; }
        finally {
            try {
                if (it_5_1 && !it_5_1.done && (_a = it_5.return)) yield __await(_a.call(it_5));
            }
            finally { if (e_24) throw e_24.error; }
        }
    });
}
function distinct ( it ) { return __asyncGenerator ( this , arguments , function * distinct_1 ( ) { var e_24 , _a ; const resultSet = new Set ( ) ; try { for ( var it_5 = __asyncValues ( it ) , it_5_1 ; it_5_1 = yield __await ( it_5 . next ( ) ) , ! it_5_1 . done ; ) { const item = it_5_1 . value ; if ( ! resultSet . has ( item ) ) { resultSet . add ( item ) ; yield yield __await ( item ) ; } } } catch ( e_24_1 ) { e_24 = { error : e_24_1 } ; } finally { try { if ( it_5_1 && ! it_5_1 . done && ( _a = it_5 . return ) ) yield __await ( _a . call ( it_5 ) ) ; } finally { if ( e_24 ) throw e_24 . error ; } } } ) ; }
Play unique items from a set
Play unique items from a set