Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔥Remove stream combinators #845

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/events.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// deno-lint-ignore-file no-explicit-any ban-types
import { createSignal } from "./signal.ts";
import { resource } from "./instructions.ts";
import { first } from "./mod.ts";
import type { Operation, Stream, Subscription } from "./types.ts";

type FN = (...any: any[]) => any;
Expand Down Expand Up @@ -32,7 +31,13 @@ export function once<
T extends EventTarget,
K extends EventList<T> | (string & {}),
>(target: T, name: K): Operation<EventTypeFromEventTarget<T, K>> {
return first(on(target, name));
return {
*[Symbol.iterator]() {
let subscription = yield* on(target, name).subscribe();
let next = yield* subscription.next();
return next.value;
},
};
}

/**
Expand Down
33 changes: 0 additions & 33 deletions lib/filter.ts

This file was deleted.

13 changes: 0 additions & 13 deletions lib/first.ts

This file was deleted.

27 changes: 0 additions & 27 deletions lib/map.ts

This file was deleted.

4 changes: 0 additions & 4 deletions lib/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ export * from "./instructions.ts";
export * from "./call.ts";
export * from "./run.ts";
export * from "./sleep.ts";
export * from "./first.ts";
export * from "./async.ts";
export * from "./abort-signal.ts";
export * from "./result.ts";
export * from "./map.ts";
export * from "./filter.ts";
export * from "./pipe.ts";
export * from "./lift.ts";
export * from "./events.ts";
export * from "./main.ts";
Expand Down
273 changes: 0 additions & 273 deletions lib/pipe.ts

This file was deleted.

Loading
Loading