@@ -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,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"
|
||||
|
||||
Reference in New Issue
Block a user