Skip to content

Commit

Permalink
Merge pull request #845 from thefrontside/v3-remove-stream-combinators
Browse files Browse the repository at this point in the history
🔥Remove stream combinators
  • Loading branch information
cowboyd authored Dec 13, 2023
2 parents 4c8168c + eea309c commit cc8408f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 684 deletions.
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

0 comments on commit cc8408f

Please sign in to comment.