Subscribable
Lint / lint (push) Successful in 11s

This commit is contained in:
Julien Valverdé
2025-08-22 16:55:10 +02:00
parent 94c2ebb0ef
commit 3eb1ef6a8d
4 changed files with 33 additions and 4 deletions
@@ -0,0 +1,24 @@
import { Effect, Effectable, Readable, Stream, Subscribable } from "effect"
class SubscribableImpl<A, E, R>
extends Effectable.Class<A, E, R> implements Subscribable.Subscribable<A, E, R> {
readonly [Readable.TypeId]: Readable.TypeId = Readable.TypeId
readonly [Subscribable.TypeId]: Subscribable.TypeId = Subscribable.TypeId
constructor(
readonly get: Effect.Effect<A, E, R>,
readonly changes: Stream.Stream<A, E, R>,
) {
super()
}
commit() {
return this.get
}
}
export const make = <A, E, R>(values: {
readonly get: Effect.Effect<A, E, R>
readonly changes: Stream.Stream<A, E, R>
}): Subscribable.Subscribable<A, E, R> => new SubscribableImpl(values.get, values.changes)
+1
View File
@@ -1,3 +1,4 @@
export * as PropertyPath from "./PropertyPath.js"
export * as SetStateAction from "./SetStateAction.js"
export * as Subscribable from "./Subscribable.js"
export * as SubscriptionSubRef from "./SubscriptionSubRef.js"