From 68fcfc19e5b6642b5a04bc76cdebc0e2a5642e2a Mon Sep 17 00:00:00 2001 From: Dag Brattli Date: Sat, 14 Mar 2026 11:31:34 +0100 Subject: [PATCH 1/2] refactor!: rename AsyncRx to Reactive and IAsyncRxDisposable to IReactiveDisposable Align public API naming with F# component design guidelines: - `AsyncRx` module -> `Reactive` module with `[]` - `IAsyncRxDisposable` -> `IReactiveDisposable` - `asyncRx { }` computation expression -> `reactive { }` - Paket group `AsyncRx` -> `Reactive` BREAKING CHANGE: All usages of `AsyncRx.xxx` must be updated to `Reactive.xxx`, `IAsyncRxDisposable` to `IReactiveDisposable`, and `asyncRx { }` to `reactive { }`. Co-Authored-By: Claude Opus 4.6 (1M context) --- CLAUDE.md | 8 ++++---- Fable.Reactive.sln | 2 +- README.md | 10 ++++----- extra/AsyncSeq/AsyncSeq.fs | 4 ++-- extra/AsyncSeq/README.md | 4 ++-- paket.dependencies | 2 +- paket.lock | 2 +- src/AsyncDisposable.fs | 18 ++++++++-------- src/AsyncObservable.fs | 7 ++++--- src/AsyncObserver.fs | 8 ++++---- src/Builder.fs | 4 ++-- src/Combine.fs | 2 +- src/Create.fs | 14 ++++++------- src/Fable.Reactive.fsproj | 2 +- src/Subject.fs | 4 ++-- src/Transform.fs | 8 ++++---- src/Types.fs | 8 ++++---- src/paket.references | 2 +- test/AsyncSeqTest.fs | 4 ++-- test/BuilderTest.fs | 26 +++++++++++------------ test/CallCCTest.fs | 4 ++-- test/CatchTest.fs | 14 ++++++------- test/ConcatTest.fs | 42 +++++++++++++++++++------------------- test/CreateTest.fs | 10 ++++----- test/DebounceTest.fs | 12 +++++------ test/FilterTest.fs | 6 +++--- test/FlatMapTest.fs | 32 ++++++++++++++--------------- test/GroupByTest.fs | 24 +++++++++++----------- test/MapTest.fs | 8 ++++---- test/MergeTest.fs | 28 ++++++++++++------------- test/ObserverTest.fs | 8 ++++---- test/ScanTest.fs | 6 +++--- test/SubjectTest.fs | 8 ++++---- test/SwitchTest.fs | 5 ++--- test/TakeUntilTest.fs | 2 +- test/TimeshiftTest.fs | 12 +++++------ 36 files changed, 179 insertions(+), 181 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index f34d997..57ccd76 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -42,7 +42,7 @@ Example test pattern: ```fsharp testAsync "Test name" { - let xs = AsyncRx.single 42 |> AsyncRx.map (fun x -> x * 10) + let xs = Reactive.single 42 |> Reactive.map (fun x -> x * 10) let obv = TestObserver() let! sub = xs.SubscribeAsync obv let! latest = obv.Await() @@ -54,7 +54,7 @@ testAsync "Test name" { ### Core Types (`src/Types.fs`) -- `IAsyncRxDisposable` - Async disposable (Fable-compatible name) +- `IReactiveDisposable` - Async disposable for subscriptions - `IAsyncObserver<'T>` - Async observer with OnNextAsync/OnErrorAsync/OnCompletedAsync - `IAsyncObservable<'T>` - Async observable with SubscribeAsync - `Notification<'T>` - OnNext/OnError/OnCompleted discriminated union @@ -71,8 +71,8 @@ testAsync "Test name" { | Aggregate.fs | `scan`, `reduce`, `groupBy`, `min`, `max` | | Timeshift.fs | `delay`, `debounce`, `sample` | | Subject.fs | Hot/cold stream subjects for multicast | -| AsyncObservable.fs | Main API module exporting all operators via `AsyncRx` | -| Builder.fs | Query/computation expression builder (`asyncRx { }`) | +| AsyncObservable.fs | Main API module exporting all operators via `Reactive` | +| Builder.fs | Query/computation expression builder (`reactive { }`) | ### Key Patterns diff --git a/Fable.Reactive.sln b/Fable.Reactive.sln index 60015df..a87ecc1 100644 --- a/Fable.Reactive.sln +++ b/Fable.Reactive.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26124.0 MinimumVisualStudioVersion = 15.0.26124.0 -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "AsyncRx", "src\Fable.Reactive.fsproj", "{8D83B5B9-A2E2-45F4-8B8E-B4A65CFF4CC9}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fable.Reactive", "src\Fable.Reactive.fsproj", "{8D83B5B9-A2E2-45F4-8B8E-B4A65CFF4CC9}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Tests", "test\Tests.fsproj", "{B384F8B3-C04F-4F47-8DB0-B1E9B6339B5C}" EndProject diff --git a/README.md b/README.md index 26ad223..9f553fa 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![codecov](https://codecov.io/gh/dbrattli/AsyncRx/branch/main/graph/badge.svg)](https://codecov.io/gh/dbrattli/AsyncRx) [![Nuget](https://img.shields.io/nuget/vpre/Fable.Reactive)](https://www.nuget.org/packages/Fable.Reactive/) -> Fable.Reactive is a lightweight Async Reactive (AsyncRx) library for F#. +> Fable.Reactive is a lightweight Async Reactive library for F#. Fable.Reactive is a library for asynchronous reactive programming, and is the implementation of Async Observables @@ -35,16 +35,14 @@ your open statements: + open Fable.Reactive ``` -All sub-namespaces have been renamed accordingly: +All sub-namespaces and modules have been renamed accordingly: | Old | New | |-----|-----| | `FSharp.Control` | `Fable.Reactive` | | `FSharp.Control.Core` | `Fable.Reactive.Core` | -| `FSharp.Control.AsyncRx` | `Fable.Reactive.AsyncRx` | -| `FSharp.Control.Subjects` | `Fable.Reactive.Subjects` | - -The API itself remains unchanged. +| `AsyncRx` module | `Reactive` module | +| `IAsyncRxDisposable` | `IReactiveDisposable` | ## Documentation diff --git a/extra/AsyncSeq/AsyncSeq.fs b/extra/AsyncSeq/AsyncSeq.fs index d413d46..a968a65 100644 --- a/extra/AsyncSeq/AsyncSeq.fs +++ b/extra/AsyncSeq/AsyncSeq.fs @@ -5,10 +5,10 @@ open FSharp.Control open Fable.Reactive [] -module AsyncRx = +module Reactive = /// Convert async sequence into an async observable. let ofAsyncSeq (xs: AsyncSeq<'TSource>) : IAsyncObservable<'TSource> = - let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = + let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = let cancel, token = canceller () async { diff --git a/extra/AsyncSeq/README.md b/extra/AsyncSeq/README.md index 0cd79ab..ad15178 100644 --- a/extra/AsyncSeq/README.md +++ b/extra/AsyncSeq/README.md @@ -2,8 +2,8 @@ Extension for converting to and from AsyncSeq. Adds to functions: -- `AsyncRx.ofAsyncSeq` -- `AsyncRx.toAsyncSeq` +- `Reactive.ofAsyncSeq` +- `Reactive.toAsyncSeq` ## Install diff --git a/paket.dependencies b/paket.dependencies index c59bf4b..658c0b7 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -1,4 +1,4 @@ -group AsyncRx +group Reactive source https://api.nuget.org/v3/index.json framework: netstandard2.0 diff --git a/paket.lock b/paket.lock index 4c19b16..9ffc5a6 100644 --- a/paket.lock +++ b/paket.lock @@ -1,6 +1,6 @@ -GROUP AsyncRx +GROUP Reactive RESTRICTION: == netstandard2.0 NUGET remote: https://api.nuget.org/v3/index.json diff --git a/src/AsyncDisposable.fs b/src/AsyncDisposable.fs index 260d5c5..7e3b08d 100644 --- a/src/AsyncDisposable.fs +++ b/src/AsyncDisposable.fs @@ -9,7 +9,7 @@ open Fable.Reactive.Core type AsyncDisposable private (cancel) = let mutable isDisposed = 0 - interface IAsyncRxDisposable with + interface IReactiveDisposable with member this.DisposeAsync() = async { #if FABLE_COMPILER @@ -22,21 +22,21 @@ type AsyncDisposable private (cancel) = #endif } - static member Create cancel : IAsyncRxDisposable = - AsyncDisposable cancel :> IAsyncRxDisposable + static member Create cancel : IReactiveDisposable = + AsyncDisposable cancel :> IReactiveDisposable - static member Empty: IAsyncRxDisposable = + static member Empty: IReactiveDisposable = let cancel () = async { return () } - AsyncDisposable cancel :> IAsyncRxDisposable + AsyncDisposable cancel :> IReactiveDisposable - static member Composite(disposables: IAsyncRxDisposable seq) : IAsyncRxDisposable = + static member Composite(disposables: IReactiveDisposable seq) : IReactiveDisposable = let cancel () = async { for d in disposables do do! d.DisposeAsync() } - AsyncDisposable cancel :> IAsyncRxDisposable + AsyncDisposable cancel :> IReactiveDisposable type Disposable(cancel) = let mutable isDisposed = 0 @@ -68,7 +68,7 @@ type Disposable(cancel) = [] module AsyncDisposable = - type IAsyncRxDisposable with + type IReactiveDisposable with member this.ToDisposable() = { new IDisposable with @@ -76,7 +76,7 @@ module AsyncDisposable = type System.IDisposable with - member this.ToAsyncDisposable() : IAsyncRxDisposable = + member this.ToAsyncDisposable() : IReactiveDisposable = AsyncDisposable.Create(fun () -> async { this.Dispose() }) let canceller () = diff --git a/src/AsyncObservable.fs b/src/AsyncObservable.fs index 1189296..46e52c2 100644 --- a/src/AsyncObservable.fs +++ b/src/AsyncObservable.fs @@ -24,7 +24,7 @@ module AsyncObservable = member this.Run(obv: IAsyncObserver<'TSource>) = this.RunAsync obv |> Async.Start' /// Subscribes the async observer function (`Notification{'a} -> Async{unit}`) to the AsyncObservable - member this.SubscribeAsync<'TSource>(obv: Notification<'TSource> -> Async) : Async = + member this.SubscribeAsync<'TSource>(obv: Notification<'TSource> -> Async) : Async = this.SubscribeAsync(AsyncObserver obv) /// Returns an observable sequence that contains the elements of the given sequences concatenated together. @@ -50,7 +50,8 @@ module Observable = /// A single module that contains all the operators. Nicer and shorter way than writing AsyncObservable. We want to /// prefix our operators so we don't mix e.g. `map` with other modules. -module AsyncRx = +[] +module Reactive = // Aggregate Region @@ -135,7 +136,7 @@ module AsyncRx = /// Creates an async observable (`AsyncObservable{'a}`) from the /// given subscribe function. - let create (subscribe: IAsyncObserver<'a> -> Async) : IAsyncObservable<'a> = + let create (subscribe: IAsyncObserver<'a> -> Async) : IAsyncObservable<'a> = Create.create subscribe // Returns an observable sequence that invokes the specified factory diff --git a/src/AsyncObserver.fs b/src/AsyncObserver.fs index 3a35792..9c104ce 100644 --- a/src/AsyncObserver.fs +++ b/src/AsyncObserver.fs @@ -44,7 +44,7 @@ module AsyncObserver = /// Safe observer that wraps the given observer. Makes sure that invocations are serialized and that the Rx grammar /// (OnNext* (OnError|OnCompleted)?) is not violated. - let safeObserver (obv: IAsyncObserver<'TSource>) (disposable: IAsyncRxDisposable) : IAsyncObserver<'TSource> = + let safeObserver (obv: IAsyncObserver<'TSource>) (disposable: IReactiveDisposable) : IAsyncObserver<'TSource> = let agent = spawn (fun inbox -> let rec messageLoop stopped = @@ -85,12 +85,12 @@ module AsyncObserver = member this.OnCompletedAsync() = async { OnCompleted |> agent.Post } } type private Msg = - | Disposable of IAsyncRxDisposable + | Disposable of IReactiveDisposable | Dispose let autoDetachObserver (obv: IAsyncObserver<'TSource>) - : IAsyncObserver<'TSource> * (Async -> Async) = + : IAsyncObserver<'TSource> * (Async -> Async) = let agent = spawn (fun inbox -> let rec messageLoop disposables = @@ -117,7 +117,7 @@ module AsyncObserver = let safeObv = AsyncDisposable.Create cancel |> safeObserver obv // Auto-detaches (disposes) the disposable when the observer completes with success or error. - let autoDetach (disposable: Async) = + let autoDetach (disposable: Async) = async { let! disp = disposable agent.Post(Disposable disp) diff --git a/src/Builder.fs b/src/Builder.fs index 617ec42..0baf02a 100644 --- a/src/Builder.fs +++ b/src/Builder.fs @@ -38,12 +38,12 @@ type QueryBuilder() = [] module QueryBuilder = /// Query builder for an async reactive event source - let asyncRx = QueryBuilder() + let reactive = QueryBuilder() /// We extend AsyncBuilder to use `use!` for resource managemnt when using async builder. type AsyncBuilder with - member builder.Using(resource: #IAsyncRxDisposable, f: #IAsyncRxDisposable -> Async<'TSource>) = + member builder.Using(resource: #IReactiveDisposable, f: #IReactiveDisposable -> Async<'TSource>) = let mutable x = 0 let disposeFunction _ = diff --git a/src/Combine.fs b/src/Combine.fs index 7f5ee8a..ba7ea1a 100644 --- a/src/Combine.fs +++ b/src/Combine.fs @@ -7,7 +7,7 @@ module internal Combine = type Key = int type Model<'a> = - { Subscriptions: Map + { Subscriptions: Map Queue: IAsyncObservable<'a> list IsStopped: bool Key: Key } diff --git a/src/Create.fs b/src/Create.fs index fe92d44..40e6fe7 100644 --- a/src/Create.fs +++ b/src/Create.fs @@ -15,7 +15,7 @@ module internal Create = /// Creates an async observable (`AsyncObservable{'TSource}`) from the /// given subscribe function. - let create (subscribe: IAsyncObserver<'TSource> -> Async) : IAsyncObservable<'TSource> = + let create (subscribe: IAsyncObserver<'TSource> -> Async) : IAsyncObservable<'TSource> = { new IAsyncObservable<'TSource> with member _.SubscribeAsync o = subscribe o } @@ -23,7 +23,7 @@ module internal Create = let ofAsyncWorker (worker: IAsyncObserver<'TSource> -> CancellationToken -> Async) : IAsyncObservable<'TSource> = - let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = + let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = let disposable, token = canceller () let safeObv = safeObserver aobv disposable @@ -49,7 +49,7 @@ module internal Create = /// Returns an observable sequence containing the single specified element. let single (value: 'TSource) = - let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = + let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = let safeObv = safeObserver aobv AsyncDisposable.Empty async { @@ -63,7 +63,7 @@ module internal Create = /// Returns an observable sequence with no elements. let inline empty<'TSource> () : IAsyncObservable<'TSource> = - let subscribeAsync (aobv: IAsyncObserver<_>) : Async = + let subscribeAsync (aobv: IAsyncObserver<_>) : Async = async { do! aobv.OnCompletedAsync() return AsyncDisposable.Empty @@ -74,7 +74,7 @@ module internal Create = /// Returns an empty observable sequence that never completes. let inline never<'TSource> () : IAsyncObservable<'TSource> = - let subscribeAsync (_: IAsyncObserver<_>) : Async = async { return AsyncDisposable.Empty } + let subscribeAsync (_: IAsyncObserver<_>) : Async = async { return AsyncDisposable.Empty } { new IAsyncObservable<'TSource> with member _.SubscribeAsync o = subscribeAsync o } @@ -100,7 +100,7 @@ module internal Create = // Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. let defer (factory: unit -> IAsyncObservable<'TSource>) : IAsyncObservable<'TSource> = - let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = + let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = async { let result = try @@ -117,7 +117,7 @@ module internal Create = /// Returns an observable sequence that triggers the increasing sequence starting with 0 after the given msecs, and /// the after each period. let interval (msecs: int) (period: int) : IAsyncObservable = - let subscribeAsync (aobv: IAsyncObserver) : Async = + let subscribeAsync (aobv: IAsyncObserver) : Async = let cancel, token = canceller () async { diff --git a/src/Fable.Reactive.fsproj b/src/Fable.Reactive.fsproj index 472b0e1..1e0c978 100644 --- a/src/Fable.Reactive.fsproj +++ b/src/Fable.Reactive.fsproj @@ -7,7 +7,7 @@ true LICENSE fsharp;fable;fable-library;fable-dotnet;fable-javascript;fable-python - Async Reactive (AsyncRx) library for F# and Fable + Async Reactive library for F# and Fable diff --git a/src/Subject.fs b/src/Subject.fs index 6bae240..8a7a182 100644 --- a/src/Subject.fs +++ b/src/Subject.fs @@ -54,7 +54,7 @@ module internal Subjects = waitForSubscriber []) - let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = + let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = let sobv = safeObserver aobv AsyncDisposable.Empty actor.Post(Subscribe sobv) @@ -99,7 +99,7 @@ module internal Subjects = messageLoop ()) - let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = + let subscribeAsync (aobv: IAsyncObserver<'TSource>) : Async = async { let sobv = safeObserver aobv AsyncDisposable.Empty obvs.Add sobv diff --git a/src/Transform.fs b/src/Transform.fs index 4b1b98f..1462fc7 100644 --- a/src/Transform.fs +++ b/src/Transform.fs @@ -12,7 +12,7 @@ module internal Transform = (nextAsync: ('TResult -> Async) -> 'TSource -> Async) (source: IAsyncObservable<'TSource>) : IAsyncObservable<'TResult> = - let subscribeAsync (aobv: IAsyncObserver<'TResult>) : Async = + let subscribeAsync (aobv: IAsyncObserver<'TResult>) : Async = { new IAsyncObserver<'TSource> with member _.OnNextAsync x = nextAsync aobv.OnNextAsync x member _.OnErrorAsync err = aobv.OnErrorAsync err @@ -101,7 +101,7 @@ module internal Transform = let agent = spawn (fun inbox -> - let rec messageLoop (current: IAsyncRxDisposable option, isStopped, currentId) = + let rec messageLoop (current: IReactiveDisposable option, isStopped, currentId) = async { let! cmd = inbox.Receive() @@ -239,7 +239,7 @@ module internal Transform = let mb = spawn (fun inbox -> - let rec messageLoop (count: int) (subscription: IAsyncRxDisposable) = + let rec messageLoop (count: int) (subscription: IReactiveDisposable) = async { let! cmd = inbox.Receive() @@ -282,7 +282,7 @@ module internal Transform = member _.SubscribeAsync o = subscribeAsync o } let toObservable (source: IAsyncObservable<'TSource>) : IObservable<'TSource> = - let mutable subscription: IAsyncRxDisposable = AsyncDisposable.Empty + let mutable subscription: IReactiveDisposable = AsyncDisposable.Empty { new IObservable<'TSource> with member _.Subscribe obv = diff --git a/src/Types.fs b/src/Types.fs index 062e2cc..5261b99 100644 --- a/src/Types.fs +++ b/src/Types.fs @@ -1,17 +1,17 @@ namespace Fable.Reactive -/// FSharp version of IAsyncDisposable. We use a different name to avoid name conflicts. -type IAsyncRxDisposable = +/// Async disposable interface for Fable.Reactive subscriptions. +type IReactiveDisposable = abstract member DisposeAsync: unit -> Async -/// FSharp version of IAsyncRxDisposable +/// Async observer with OnNextAsync/OnErrorAsync/OnCompletedAsync. type IAsyncObserver<'T> = abstract member OnNextAsync: 'T -> Async abstract member OnErrorAsync: exn -> Async abstract member OnCompletedAsync: unit -> Async type IAsyncObservable<'T> = - abstract member SubscribeAsync: IAsyncObserver<'T> -> Async + abstract member SubscribeAsync: IAsyncObserver<'T> -> Async type Notification<'T> = | OnNext of 'T diff --git a/src/paket.references b/src/paket.references index d055275..b6f4876 100644 --- a/src/paket.references +++ b/src/paket.references @@ -1,3 +1,3 @@ -group AsyncRx +group Reactive FSharp.Core Fable.Actor diff --git a/test/AsyncSeqTest.fs b/test/AsyncSeqTest.fs index ba99152..d36d0a3 100644 --- a/test/AsyncSeqTest.fs +++ b/test/AsyncSeqTest.fs @@ -17,7 +17,7 @@ let toTask computation : Task = Async.StartAsTask computation :> _ let tests = testList "Async Seq Tests" [ testAsync "Test to async seq" { - let xs = seq { 1..5 } |> AsyncRx.ofSeq |> AsyncRx.toAsyncSeq + let xs = seq { 1..5 } |> Reactive.ofSeq |> Reactive.toAsyncSeq let result = List () let each x = async { @@ -35,7 +35,7 @@ let tests = testList "Async Seq Tests" [ } testAsync "Test seq to async seq to async observerable to async seq" { - let xs = seq { 1..5 } |> AsyncSeq.ofSeq |> AsyncRx.ofAsyncSeq |> AsyncRx.toAsyncSeq + let xs = seq { 1..5 } |> AsyncSeq.ofSeq |> Reactive.ofAsyncSeq |> Reactive.toAsyncSeq let result = List () let each x = async { diff --git a/test/BuilderTest.fs b/test/BuilderTest.fs index 0e84acf..28f3f55 100644 --- a/test/BuilderTest.fs +++ b/test/BuilderTest.fs @@ -12,7 +12,7 @@ let tests = testList "Query Tests" [ testAsync "test empty query" { // Arrange - let xs = asyncRx { + let xs = reactive { () } let obv = TestObserver() @@ -36,9 +36,9 @@ let tests = testList "Query Tests" [ // Arrange let obv = TestObserver() - let xs = asyncRx { - let! a = seq [1; 2] |> AsyncRx.ofSeq - let! b = seq [3; 4] |> AsyncRx.ofSeq + let xs = reactive { + let! a = seq [1; 2] |> Reactive.ofSeq + let! b = seq [3; 4] |> Reactive.ofSeq yield a + b } @@ -57,8 +57,8 @@ let tests = testList "Query Tests" [ // Arrange let obv = TestObserver() - let xs = asyncRx { - yield! AsyncRx.single 42 + let xs = reactive { + yield! Reactive.single 42 } // Act @@ -75,7 +75,7 @@ let tests = testList "Query Tests" [ // Arrange let obv = TestObserver() - let xs = asyncRx { + let xs = reactive { yield 42 } @@ -93,7 +93,7 @@ let tests = testList "Query Tests" [ // Arrange let obv = TestObserver() - let xs = asyncRx { + let xs = reactive { yield 42 yield 43 } @@ -112,8 +112,8 @@ let tests = testList "Query Tests" [ // Arrange let obv = TestObserver() - let xs = asyncRx { - let xs = AsyncRx.ofSeq [1; 2; 3] + let xs = reactive { + let xs = Reactive.ofSeq [1; 2; 3] for x in xs do yield x * 10 } @@ -132,7 +132,7 @@ let tests = testList "Query Tests" [ // Arrange let obv = TestObserver() - let xs = asyncRx { + let xs = reactive { for x in [1; 2; 3] do yield x * 10 } @@ -151,7 +151,7 @@ let tests = testList "Query Tests" [ // Arrange let obv = TestObserver() - let xs = asyncRx { + let xs = reactive { let! b = async { return 42 } yield b + 2 } @@ -168,7 +168,7 @@ let tests = testList "Query Tests" [ testAsync "test query async dispose with use!" { // Arrange - let xs = AsyncRx.timer 10 + let xs = Reactive.timer 10 let obv = TestObserver () // Act diff --git a/test/CallCCTest.fs b/test/CallCCTest.fs index 75c03b2..72b9b06 100644 --- a/test/CallCCTest.fs +++ b/test/CallCCTest.fs @@ -2,7 +2,7 @@ module Tests.CallCC open System.Threading.Tasks -open Reaction.AsyncRx +open Fable.Reactive open NUnit.Framework open FsUnit @@ -23,7 +23,7 @@ let ``Test callCC``() = toTask <| async { else abort (OnNext -1) - let xs = asyncRx { + let xs = reactive { let! x = single 5 yield! callCC (fun abort -> diff --git a/test/CatchTest.fs b/test/CatchTest.fs index aab097a..13f7fe0 100644 --- a/test/CatchTest.fs +++ b/test/CatchTest.fs @@ -19,7 +19,7 @@ let tests = // Arrange let xs = fromNotification [ OnNext 1; OnNext 2; OnNext 3; OnCompleted ] let ys = fromNotification [ OnNext 4; OnNext 5; OnNext 6; OnCompleted ] - let zs = xs |> AsyncRx.catch (fun _ -> ys) + let zs = xs |> Reactive.catch (fun _ -> ys) let obv = TestObserver() // Act @@ -38,7 +38,7 @@ let tests = let error = MyError "error" let xs = fromNotification [ OnNext 1; OnNext 2; OnNext 3; OnError error ] let ys = fromNotification [ OnNext 4; OnNext 5; OnNext 6; OnCompleted ] - let zs = xs |> AsyncRx.catch (fun _ -> ys) + let zs = xs |> Reactive.catch (fun _ -> ys) let obv = TestObserver() // Act @@ -61,13 +61,13 @@ let tests = let zs = xs - |> AsyncRx.catch (fun err -> + |> Reactive.catch (fun err -> let msg = match err with | MyError msg -> msg | _ -> "error" - AsyncRx.single msg) + Reactive.single msg) let obv = TestObserver() @@ -95,7 +95,7 @@ let tests = let zs = xs - |> AsyncRx.catch (fun _ -> + |> Reactive.catch (fun _ -> iter.MoveNext() |> ignore iter.Current) @@ -115,8 +115,8 @@ let tests = // Arrange let error = MyError "error" let xs = fromNotification [ OnNext 1; OnError error ] - let dispatch, fallback = AsyncRx.subject () - let zs = xs |> AsyncRx.catch (fun _ -> fallback) + let dispatch, fallback = Reactive.subject () + let zs = xs |> Reactive.catch (fun _ -> fallback) let obv = TestObserver() // Act diff --git a/test/ConcatTest.fs b/test/ConcatTest.fs index f423a39..eed1742 100644 --- a/test/ConcatTest.fs +++ b/test/ConcatTest.fs @@ -14,9 +14,9 @@ let tests = testList "Merge Tests" [ testAsync "Test concat emtpy empty" { // Arrange - let xs = AsyncRx.empty () - let ys = AsyncRx.empty () - let zs = AsyncRx.concatSeq [ xs; ys ] + let xs = Reactive.empty () + let ys = Reactive.empty () + let zs = Reactive.concatSeq [ xs; ys ] let obv = TestObserver() // Act @@ -35,9 +35,9 @@ let tests = testList "Merge Tests" [ testAsync "Test concat non emtpy empty" { // Arrange - let xs = seq { 1..3 } |> AsyncRx.ofSeq - let ys = AsyncRx.empty () - let zs = AsyncRx.concatSeq [ xs; ys ] + let xs = seq { 1..3 } |> Reactive.ofSeq + let ys = Reactive.empty () + let zs = Reactive.concatSeq [ xs; ys ] let obv = TestObserver() // Act @@ -54,9 +54,9 @@ let tests = testList "Merge Tests" [ testAsync "Test concat empty non empty" { // Arrange - let xs = AsyncRx.empty () - let ys = seq { 1..3 } |> AsyncRx.ofSeq - let zs = AsyncRx.concatSeq [ xs; ys ] + let xs = Reactive.empty () + let ys = seq { 1..3 } |> Reactive.ofSeq + let zs = Reactive.concatSeq [ xs; ys ] let obv = TestObserver() // Act @@ -73,9 +73,9 @@ let tests = testList "Merge Tests" [ testAsync "Test concat two" { // Arrange - let xs = seq { 1..3 } |> AsyncRx.ofSeq - let ys = seq { 4..6 } |> AsyncRx.ofSeq - let zs = AsyncRx.concatSeq [ xs; ys ] + let xs = seq { 1..3 } |> Reactive.ofSeq + let ys = seq { 4..6 } |> Reactive.ofSeq + let zs = Reactive.concatSeq [ xs; ys ] let obv = TestObserver () // Act @@ -92,8 +92,8 @@ let tests = testList "Merge Tests" [ testAsync "Test concat ++" { // Arrange - let xs = seq { 1..3 } |> AsyncRx.ofSeq - let ys = seq { 4..6 } |> AsyncRx.ofSeq + let xs = seq { 1..3 } |> Reactive.ofSeq + let ys = seq { 4..6 } |> Reactive.ofSeq let zs = xs ++ ys let obv = TestObserver() @@ -111,10 +111,10 @@ let tests = testList "Merge Tests" [ testAsync "Test concat three" { // Arrange - let a = seq { 1..2 } |> AsyncRx.ofSeq - let b = seq { 3..4 } |> AsyncRx.ofSeq - let c = seq { 5..6 } |> AsyncRx.ofSeq - let xs = AsyncRx.concatSeq [ a; b; c ] + let a = seq { 1..2 } |> Reactive.ofSeq + let b = seq { 3..4 } |> Reactive.ofSeq + let c = seq { 5..6 } |> Reactive.ofSeq + let xs = Reactive.concatSeq [ a; b; c ] let obv = TestObserver() // Act @@ -132,9 +132,9 @@ let tests = testList "Merge Tests" [ testAsync "Test concat fail with non emtpy" { // Arrange let error = MyError "error" - let xs = AsyncRx.fail error - let ys = seq { 1..3 } |> AsyncRx.ofSeq - let zs = AsyncRx.concatSeq [ xs; ys ] + let xs = Reactive.fail error + let ys = seq { 1..3 } |> Reactive.ofSeq + let zs = Reactive.concatSeq [ xs; ys ] let obv = TestObserver() // Act diff --git a/test/CreateTest.fs b/test/CreateTest.fs index e4487a1..18f6efb 100644 --- a/test/CreateTest.fs +++ b/test/CreateTest.fs @@ -12,7 +12,7 @@ let tests = testList "Create Tests" [ testAsync "Test single happy" { // Arrange - let xs = AsyncRx.single 42 + let xs = Reactive.single 42 let obv = TestObserver () // Act @@ -30,7 +30,7 @@ let tests = testList "Create Tests" [ testAsync "Test just dispose after subscribe" { // Arrange - let xs = AsyncRx.single 42 + let xs = Reactive.single 42 let obv = TestObserver () // Act @@ -45,7 +45,7 @@ let tests = testList "Create Tests" [ testAsync "Test ofSeq empty" { // Arrange - let xs = AsyncRx.ofSeq Seq.empty + let xs = Reactive.ofSeq Seq.empty let obv = TestObserver () // Act @@ -62,7 +62,7 @@ let tests = testList "Create Tests" [ testAsync "Test ofSeq non empty" { // Arrange - let xs = seq { 1 .. 5 } |> AsyncRx.ofSeq + let xs = seq { 1 .. 5 } |> Reactive.ofSeq let obv = TestObserver () // Act @@ -78,7 +78,7 @@ let tests = testList "Create Tests" [ testAsync "Test dispose after subscribe" { // Arrange - let xs = AsyncRx.timer 10 + let xs = Reactive.timer 10 let obv = TestObserver () // Act diff --git a/test/DebounceTest.fs b/test/DebounceTest.fs index 193ef83..8d6aac1 100644 --- a/test/DebounceTest.fs +++ b/test/DebounceTest.fs @@ -15,8 +15,8 @@ let toTask computation : Task = Async.StartAsTask computation :> _ let ``Test debounce single value``() = toTask <| async { // Arrange - let dispatch, obs = AsyncRx.stream () - let xs = obs |> AsyncRx.debounce 100 + let dispatch, obs = Reactive.stream () + let xs = obs |> Reactive.debounce 100 let obv = TestObserver () let ctx = TestSynchronizationContext () let mutable latest = -1 @@ -53,8 +53,8 @@ let ``Test debounce single value``() = toTask <| async { let ``Test debounce two immediate values``() = toTask <| async { // Arrange - let dispatch, obs = AsyncRx.stream () - let xs = obs |> AsyncRx.debounce 100 + let dispatch, obs = Reactive.stream () + let xs = obs |> Reactive.debounce 100 let obv = TestObserver() let ctx = TestSynchronizationContext () let mutable latest = -1 @@ -84,8 +84,8 @@ let ``Test debounce two immediate values``() = toTask <| async { [] let ``Test debounce two separate values``() = toTask <| async { // Arrange - let dispatch, obs = AsyncRx.stream () - let xs = obs |> AsyncRx.debounce 100 + let dispatch, obs = Reactive.stream () + let xs = obs |> Reactive.debounce 100 let obv = TestObserver() let ctx = TestSynchronizationContext () let mutable latest = -1 diff --git a/test/FilterTest.fs b/test/FilterTest.fs index 11551f1..74f1024 100644 --- a/test/FilterTest.fs +++ b/test/FilterTest.fs @@ -17,7 +17,7 @@ let tests = testList "Filter Tests" [ return x < 3 } - let xs = seq { 1..5 } |> AsyncRx.ofSeq |> AsyncRx.filterAsync predicate + let xs = seq { 1..5 } |> Reactive.ofSeq |> Reactive.filterAsync predicate let obv = TestObserver() // Act @@ -37,7 +37,7 @@ let tests = testList "Filter Tests" [ // Arrange let predicate x = x < 3 - let xs = seq { 1..5 } |> AsyncRx.ofSeq |> AsyncRx.filter predicate + let xs = seq { 1..5 } |> Reactive.ofSeq |> Reactive.filter predicate let obv = TestObserver() // Act @@ -61,7 +61,7 @@ let tests = testList "Filter Tests" [ return true } - let xs = seq { 1..5 } |> AsyncRx.ofSeq |> AsyncRx.filterAsync predicate + let xs = seq { 1..5 } |> Reactive.ofSeq |> Reactive.filterAsync predicate let obv = TestObserver() // Act diff --git a/test/FlatMapTest.fs b/test/FlatMapTest.fs index 644b595..fe2d411 100644 --- a/test/FlatMapTest.fs +++ b/test/FlatMapTest.fs @@ -10,8 +10,8 @@ let tests = testList "Filter Tests" [ testAsync "Test flatMap empty" { // Arrange - let xs = AsyncRx.empty () - let zs = xs |> AsyncRx.flatMap (fun x -> x) + let xs = Reactive.empty () + let zs = xs |> Reactive.flatMap (fun x -> x) let obv = TestObserver() // Act @@ -31,7 +31,7 @@ let tests = testList "Filter Tests" [ testAsync "Test flatMap some" { // Arrange let xs = fromNotification [ OnNext 1; OnNext 2; OnNext 3; OnCompleted] - let zs = xs |> AsyncRx.flatMap (fun x -> AsyncRx.single x) + let zs = xs |> Reactive.flatMap (fun x -> Reactive.single x) let obv = TestObserver() // Act @@ -49,8 +49,8 @@ let tests = testList "Filter Tests" [ testAsync "Test flatMap monad law left identity" { // Arrange - let f x = AsyncRx.single (x * 10) - let xs = AsyncRx.single 42 |> AsyncRx.flatMap f + let f x = Reactive.single (x * 10) + let xs = Reactive.single 42 |> Reactive.flatMap f let ys = f 42 let obv1 = TestObserver() let obv2 = TestObserver() @@ -71,8 +71,8 @@ let tests = testList "Filter Tests" [ testAsync "Test flatMap monad law right identity" { // Arrange - let m = AsyncRx.single 42 - let xs = m |> AsyncRx.flatMap AsyncRx.single + let m = Reactive.single 42 + let xs = m |> Reactive.flatMap Reactive.single let obv1 = TestObserver() let obv2 = TestObserver() @@ -91,12 +91,12 @@ let tests = testList "Filter Tests" [ /// (m >>= f) >>= g is just like doing m >>= (\x -> f x >>= g) testAsync "Test flatMap monad law associativity" { // Arrange - let m = AsyncRx.single 42 - let f x = AsyncRx.single (x * 1000) - let g x = AsyncRx.single (x * 42) + let m = Reactive.single 42 + let f x = Reactive.single (x * 1000) + let g x = Reactive.single (x * 42) - let xs = m |> AsyncRx.flatMap f |> AsyncRx.flatMap g - let ys = m |> AsyncRx.flatMap (fun x -> f x |> AsyncRx.flatMap g) + let xs = m |> Reactive.flatMap f |> Reactive.flatMap g + let ys = m |> Reactive.flatMap (fun x -> f x |> Reactive.flatMap g) let obv1 = TestObserver() let obv2 = TestObserver() @@ -116,7 +116,7 @@ let tests = testList "Filter Tests" [ testAsync "Test flatMap expression some" { // Arrange let xs = fromNotification [ OnNext 1; OnNext 2; OnNext 3; OnCompleted] - let ys = asyncRx { + let ys = reactive { let! x = xs yield x * 2 } @@ -136,7 +136,7 @@ let tests = testList "Filter Tests" [ testAsync "Test flatMap expression some for" { // Arrange let xs = fromNotification [ OnNext 1; OnNext 2; OnNext 3; OnCompleted] - let ys = asyncRx { + let ys = reactive { for x in xs do yield x * 2 } @@ -156,9 +156,9 @@ let tests = testList "Filter Tests" [ testAsync "Test flatMap expression some return bang" { // Arrange let xs = fromNotification [ OnNext 1; OnNext 2; OnNext 3; OnCompleted] - let ys = asyncRx { + let ys = reactive { let! x = xs - yield! AsyncRx.single (x * 2) + yield! Reactive.single (x * 2) } let obv = TestObserver() diff --git a/test/GroupByTest.fs b/test/GroupByTest.fs index 8fb2d5e..1c9967e 100644 --- a/test/GroupByTest.fs +++ b/test/GroupByTest.fs @@ -11,9 +11,9 @@ let tests = testList "GroupBy Tests" [ testAsync "Test groupby empty" { // Arrange - let xs = AsyncRx.empty () - |> AsyncRx.groupBy (fun _ -> 42) - |> AsyncRx.flatMap id + let xs = Reactive.empty () + |> Reactive.groupBy (fun _ -> 42) + |> Reactive.flatMap id let obv = TestObserver() // Act @@ -34,9 +34,9 @@ let tests = testList "GroupBy Tests" [ testAsync "Test groupby error" { // Arrange let error = MyError "error" - let xs = AsyncRx.fail error - |> AsyncRx.groupBy (fun _ -> 42) - |> AsyncRx.flatMap id + let xs = Reactive.fail error + |> Reactive.groupBy (fun _ -> 42) + |> Reactive.flatMap id let obv = TestObserver() // Act @@ -56,9 +56,9 @@ let tests = testList "GroupBy Tests" [ testAsync "Test groupby 2 groups" { // Arrange - let xs = AsyncRx.ofSeq [1; 2; 3; 4; 5; 6] - |> AsyncRx.groupBy (fun x -> x % 2) - |> AsyncRx.flatMap (fun x -> x |> AsyncRx.min) + let xs = Reactive.ofSeq [1; 2; 3; 4; 5; 6] + |> Reactive.groupBy (fun x -> x % 2) + |> Reactive.flatMap (fun x -> x |> Reactive.min) let obv = TestObserver () // Act @@ -81,9 +81,9 @@ let tests = testList "GroupBy Tests" [ testAsync "Test groupby cancel" { // Arrange - let xs = AsyncRx.ofSeq [1; 2; 3; 4; 5; 6] - |> AsyncRx.groupBy (fun x -> x % 2) - |> AsyncRx.flatMap id + let xs = Reactive.ofSeq [1; 2; 3; 4; 5; 6] + |> Reactive.groupBy (fun x -> x % 2) + |> Reactive.flatMap id let obv = TestObserver () // Act diff --git a/test/MapTest.fs b/test/MapTest.fs index fa8be9c..ed2d55e 100644 --- a/test/MapTest.fs +++ b/test/MapTest.fs @@ -18,8 +18,8 @@ let tests = testList "Map Tests" [ } let xs = - AsyncRx.single 42 - |> AsyncRx.mapAsync mapper + Reactive.single 42 + |> Reactive.mapAsync mapper let obv = TestObserver() // Act @@ -39,7 +39,7 @@ let tests = testList "Map Tests" [ let mapper x = x * 10 - let xs = AsyncRx.single 42 |> AsyncRx.map mapper + let xs = Reactive.single 42 |> Reactive.map mapper let obv = TestObserver() // Act @@ -62,7 +62,7 @@ let tests = testList "Map Tests" [ raise error } - let xs = AsyncRx.single "error" |> AsyncRx.mapAsync mapper + let xs = Reactive.single "error" |> Reactive.mapAsync mapper let obv = TestObserver() // Act diff --git a/test/MergeTest.fs b/test/MergeTest.fs index cceaed2..5ce4821 100644 --- a/test/MergeTest.fs +++ b/test/MergeTest.fs @@ -14,9 +14,9 @@ let tests = testList "Merge Tests" [ testAsync "Test merge non empty emtpy" { // Arrange - let xs = seq { 1..5 } |> AsyncRx.ofSeq - let ys = AsyncRx.empty () - let zs = AsyncRx.ofSeq [ xs; ys ] |> AsyncRx.mergeInner + let xs = seq { 1..5 } |> Reactive.ofSeq + let ys = Reactive.empty () + let zs = Reactive.ofSeq [ xs; ys ] |> Reactive.mergeInner let obv = TestObserver() // Act @@ -33,9 +33,9 @@ let tests = testList "Merge Tests" [ testAsync "Test merge empty non emtpy" { // Arrange - let xs = AsyncRx.empty () - let ys = seq { 1..5 } |> AsyncRx.ofSeq - let zs = AsyncRx.ofSeq [ xs; ys ] |> AsyncRx.mergeInner + let xs = Reactive.empty () + let ys = seq { 1..5 } |> Reactive.ofSeq + let zs = Reactive.ofSeq [ xs; ys ] |> Reactive.mergeInner let obv = TestObserver() // Act @@ -53,9 +53,9 @@ let tests = testList "Merge Tests" [ testAsync "Test merge error error" { // Arrange let error = MyError "error" - let xs = AsyncRx.fail error - let ys = AsyncRx.fail error - let zs = AsyncRx.ofSeq [ xs; ys ] |> AsyncRx.mergeInner + let xs = Reactive.fail error + let ys = Reactive.fail error + let zs = Reactive.ofSeq [ xs; ys ] |> Reactive.mergeInner let obv = TestObserver () // Act @@ -75,9 +75,9 @@ let tests = testList "Merge Tests" [ testAsync "Test merge two" { // Arrange - let xs = seq { 1..3 } |> AsyncRx.ofSeq - let ys = seq { 4..5 } |> AsyncRx.ofSeq - let zs = AsyncRx.ofSeq [ xs; ys ] |> AsyncRx.mergeInner + let xs = seq { 1..3 } |> Reactive.ofSeq + let ys = seq { 4..5 } |> Reactive.ofSeq + let zs = Reactive.ofSeq [ xs; ys ] |> Reactive.mergeInner let obv = TestObserver () // Act @@ -97,9 +97,9 @@ let tests = testList "Merge Tests" [ testAsync "Test subscribe immediately" { // Arrange - let obv, stream = AsyncRx.singleSubject () + let obv, stream = Reactive.singleSubject () let msgs = - Create.ofSeq [stream; AsyncRx.empty () ] |> AsyncRx.mergeInner + Create.ofSeq [stream; Reactive.empty () ] |> Reactive.mergeInner let testObv = TestObserver() diff --git a/test/ObserverTest.fs b/test/ObserverTest.fs index c6ba017..d69ea1f 100644 --- a/test/ObserverTest.fs +++ b/test/ObserverTest.fs @@ -5,7 +5,7 @@ open Fable.Reactive.Core open Expecto open Tests.Utils -open Fable.Reactive.AsyncRx +open Fable.Reactive open System.Threading exception MyError of string @@ -52,7 +52,7 @@ let tests = testList "Observer Tests" [ testAsync "Test safe observer happy" { // Arrange - let xs = AsyncRx.ofSeq [ 1..3] + let xs = Reactive.ofSeq [ 1..3] let obv = TestObserver() let safeObv = safeObserver obv AsyncDisposable.Empty @@ -148,7 +148,7 @@ let tests = testList "Observer Tests" [ let obv = TestObserver() let mutable disposed = false - let subscribeAsync (aobv : IAsyncObserver) : Async = async { + let subscribeAsync (aobv : IAsyncObserver) : Async = async { let worker = async { for x in [1..5] do do! aobv.OnNextAsync x @@ -160,7 +160,7 @@ let tests = testList "Observer Tests" [ return AsyncDisposable.Create cancel } let source = { new IAsyncObservable with member __.SubscribeAsync o = subscribeAsync o } - let xs = source |> AsyncRx.take 4 + let xs = source |> Reactive.take 4 // Act let! dispose = xs.SubscribeAsync obv diff --git a/test/ScanTest.fs b/test/ScanTest.fs index b91129d..3e0d9ad 100644 --- a/test/ScanTest.fs +++ b/test/ScanTest.fs @@ -17,7 +17,7 @@ let tests = testList "Query Tests" [ return acc + x } - let xs = AsyncRx.ofSeq <| seq { 1..5 } |> AsyncRx.scanInitAsync 0 scanner + let xs = Reactive.ofSeq <| seq { 1..5 } |> Reactive.scanInitAsync 0 scanner let obv = TestObserver() // Act @@ -36,7 +36,7 @@ let tests = testList "Query Tests" [ let scanner acc x = acc + x - let xs = AsyncRx.ofSeq <| seq { 1..5 } |> AsyncRx.scanInit 0 scanner + let xs = Reactive.ofSeq <| seq { 1..5 } |> Reactive.scanInit 0 scanner let obv = TestObserver() // Act @@ -57,7 +57,7 @@ let tests = testList "Query Tests" [ raise error 0 - let xs = AsyncRx.ofSeq <| seq { 1..5 } |> AsyncRx.scanInit 0 scanner + let xs = Reactive.ofSeq <| seq { 1..5 } |> Reactive.scanInit 0 scanner let obv = TestObserver() // Act diff --git a/test/SubjectTest.fs b/test/SubjectTest.fs index 105f40b..36fb2c2 100644 --- a/test/SubjectTest.fs +++ b/test/SubjectTest.fs @@ -12,7 +12,7 @@ let tests = testList "Subject Tests" [ testAsync "Test subject broadcasts completeness to all observers" { // Arrange - let (dispatch, stream) = AsyncRx.subject () + let (dispatch, stream) = Reactive.subject () let obv1 = TestObserver() let obv2 = TestObserver() @@ -34,7 +34,7 @@ let tests = testList "Subject Tests" [ testAsync "Test subject broadcasts error to all observers" { // Arrange - let (dispatch, stream) = AsyncRx.subject () + let (dispatch, stream) = Reactive.subject () let obv1 = TestObserver() let obv2 = TestObserver() @@ -60,7 +60,7 @@ let tests = testList "Subject Tests" [ testAsync "Test subject does not broadcast error when first observer is throws" { // Arrange - let (dispatch, stream) = AsyncRx.subject () + let (dispatch, stream) = Reactive.subject () let obv1 = TestObserver() let obv2 = TestObserver() @@ -88,7 +88,7 @@ let tests = testList "Subject Tests" [ testAsync "Test subject does not broadcast error when second observer is throws" { // Arrange - let (dispatch, stream) = AsyncRx.subject () + let (dispatch, stream) = Reactive.subject () let obv1 = TestObserver() let obv2 = TestObserver() diff --git a/test/SwitchTest.fs b/test/SwitchTest.fs index 67670d0..9bc7a36 100644 --- a/test/SwitchTest.fs +++ b/test/SwitchTest.fs @@ -1,8 +1,7 @@ module Tests.Switch open System.Threading.Tasks -open Fable.Reactive.AsyncRx -open Fable.Reactive.AsyncRx.Streams +open Fable.Reactive open NUnit.Framework open FsUnit @@ -18,7 +17,7 @@ let ``Test switch2``() = toTask <| async { let obvA, a = stream () let obvB, b = stream () let obvX, xs = stream> () - let ys = xs |> AsyncRx.flatMapLatest (fun x -> x) + let ys = xs |> Reactive.flatMapLatest (fun x -> x) let obv = TestObserver() diff --git a/test/TakeUntilTest.fs b/test/TakeUntilTest.fs index 88ff1f1..b2fd711 100644 --- a/test/TakeUntilTest.fs +++ b/test/TakeUntilTest.fs @@ -15,7 +15,7 @@ let tests = testList "TakeUntil Tests" [ // Arrange let obvX, xs = subject () let obvY, ys = subject () - let zs = xs |> AsyncRx.takeUntil ys + let zs = xs |> Reactive.takeUntil ys let obv = TestObserver() diff --git a/test/TimeshiftTest.fs b/test/TimeshiftTest.fs index 30e2519..57c5f9e 100644 --- a/test/TimeshiftTest.fs +++ b/test/TimeshiftTest.fs @@ -12,7 +12,7 @@ let tests = [ testAsync "Test delay values are delayed" { // Arrange let xs = fromNotification [ OnNext 1; OnNext 2; OnCompleted ] - let delayed = xs |> AsyncRx.delay 50 + let delayed = xs |> Reactive.delay 50 let obv = TestObserver() // Act @@ -28,7 +28,7 @@ let tests = testAsync "Test delay can resubscribe after dispose" { // Arrange - each subscription should get its own CTS let xs = fromNotification [ OnNext 1; OnCompleted ] - let delayed = xs |> AsyncRx.delay 50 + let delayed = xs |> Reactive.delay 50 // Act - first subscription let obv1 = TestObserver() @@ -49,8 +49,8 @@ let tests = testAsync "Test debounce emits last value after timeout" { // Arrange - let dispatch, source = AsyncRx.subject () - let debounced = source |> AsyncRx.debounce 50 + let dispatch, source = Reactive.subject () + let debounced = source |> Reactive.debounce 50 let obv = TestObserver() // Act @@ -68,8 +68,8 @@ let tests = testAsync "Test debounce dispose cancels pending timers" { // Arrange - let dispatch, source = AsyncRx.subject () - let debounced = source |> AsyncRx.debounce 200 + let dispatch, source = Reactive.subject () + let debounced = source |> Reactive.debounce 200 let obv = TestObserver() // Act From 43f1e95d13275daf2110fffb36f62945d3b93c82 Mon Sep 17 00:00:00 2001 From: Dag Brattli Date: Sat, 14 Mar 2026 11:32:33 +0100 Subject: [PATCH 2/2] docs: update README badges and remove outdated documentation link Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9f553fa..e6ddcd6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Fable.Reactive -![Build and Test](https://github.com/dbrattli/AsyncRx/workflows/Build%20and%20Test/badge.svg) -[![codecov](https://codecov.io/gh/dbrattli/AsyncRx/branch/main/graph/badge.svg)](https://codecov.io/gh/dbrattli/AsyncRx) +![Build and Test](https://github.com/dbrattli/Fable.Reactive/workflows/Build%20and%20Test/badge.svg) [![Nuget](https://img.shields.io/nuget/vpre/Fable.Reactive)](https://www.nuget.org/packages/Fable.Reactive/) > Fable.Reactive is a lightweight Async Reactive library for F#. @@ -46,7 +45,7 @@ All sub-namespaces and modules have been renamed accordingly: ## Documentation -Please check out the [documentation](https://fablereaction.readthedocs.io/en/latest/asyncrx/index.html) +Documentation is currently being updated. ## Install