0.1.4 (#5)
Co-authored-by: Julien Valverdé <julien.valverde@mailo.com> Reviewed-on: Thilawyn/effect-fc#5
This commit was merged in pull request #5.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { type Effect, Effectable, Readable, type 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)
|
||||
Reference in New Issue
Block a user