Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jessekelly881 committed Apr 21, 2024
1 parent e6fa5a5 commit dd96324
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/rx/src/Rx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,9 @@ function makeStream<A, E>(
// -----------------------------------------------------------------------------

/** @internal */
const readSub = (subRx: Rx<Subscribable.Subscribable<any, any> | Result.Result<Subscribable.Subscribable<any, any>, any>>) => (get: Context) => {
const readSub =
(subRx: Rx<Subscribable.Subscribable<any, any> | Result.Result<Subscribable.Subscribable<any, any>, any>>) =>
(get: Context) => {
const sub = get(subRx)
if (Subscribable.TypeId in sub) {
get.addFinalizer(
Expand All @@ -679,7 +681,6 @@ const readSub = (subRx: Rx<Subscribable.Subscribable<any, any> | Result.Result<S
return makeStream(get, sub.value.changes, Result.initial(true))
}


const makeSubRef = (
refRx: Rx<SubscriptionRef.SubscriptionRef<any> | Result.Result<SubscriptionRef.SubscriptionRef<any>, any>>
) => {
Expand Down Expand Up @@ -736,7 +737,6 @@ export const makeSub = (
subRx: Rx<Subscribable.Subscribable<any, any> | Result.Result<Subscribable.Subscribable<any, any>, any>>
) => readable(readSub(subRx))


/**
* @since 1.0.0
* @category constructors
Expand Down
9 changes: 4 additions & 5 deletions packages/rx/test/Rx.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Registry from "@effect-rx/rx/Registry"
import * as Result from "@effect-rx/rx/Result"
import * as Rx from "@effect-rx/rx/Rx"
import { Cause, Either, FiberRef, Queue, Subscribable, SubscriptionRef } from "effect"
import { Cause, Either, FiberRef, Subscribable, SubscriptionRef } from "effect"
import * as Context from "effect/Context"
import * as Effect from "effect/Effect"
import * as Hash from "effect/Hash"
Expand Down Expand Up @@ -774,17 +774,17 @@ describe("Rx", () => {
const r = Registry.make()
assert.deepStrictEqual(r.get(rx), Either.right(123))
})

it("Subscribable", async () => {
vitest.useRealTimers()
const sub = Subscribable.make({ get: Effect.succeed(123), changes: Stream.empty })
const rx = Rx.sub(sub)
const r = Registry.make()
const unmount = r.mount(rx)
assert.deepStrictEqual(r.get(rx),123)
assert.deepStrictEqual(r.get(rx), 123)
unmount()
})

it("Subscribable/SubscriptionRef", async () => {
vitest.useRealTimers()
const ref = SubscriptionRef.make(123).pipe(Effect.runSync)
Expand All @@ -795,7 +795,6 @@ describe("Rx", () => {
unmount()
})


it("SubscriptionRef", async () => {
vitest.useRealTimers()
const ref = SubscriptionRef.make(0).pipe(Effect.runSync)
Expand Down

0 comments on commit dd96324

Please sign in to comment.