Skip to content

Commit

Permalink
Change reaction -> elmish streams
Browse files Browse the repository at this point in the history
  • Loading branch information
theimowski committed May 10, 2019
1 parent 794c5cc commit 23590af
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 56 deletions.
2 changes: 1 addition & 1 deletion Content/paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ group Client
nuget Fable.Elmish.HMR ~> 4
nuget Fable.Elmish.React ~> 3
//#if (reaction)
nuget Fable.Elmish.Reaction ~> 3
nuget Fable.Elmish.Streams ~> 3
//#endif
//#if (!remoting)
nuget Fable.Fetch ~> 2
Expand Down
17 changes: 11 additions & 6 deletions Content/src/Client/Client.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ module Client

open Elmish
open Elmish.React
#if (reaction)
open Elmish.Streams
open FSharp.Control
#endif
#if (layout == "fulma-admin" || layout == "fulma-cover" || layout == "fulma-hero" || layout == "fulma-landing" || layout == "fulma-login")
open Fable.FontAwesome
open Fable.FontAwesome.Free
Expand All @@ -14,9 +18,6 @@ open Fetch.Types
#if (layout != "none")
open Fulma
#endif
#if (reaction)
open Reaction
#endif
open Thoth.Json

open Shared
Expand Down Expand Up @@ -142,8 +143,12 @@ let load = AsyncRx.ofPromise (initialCounter [])
let loadCount =
load
|> AsyncRx.map InitialCountLoaded
|> AsyncRx.toStream "loading"

let query msgs = loadCount ++ msgs
let stream model msgs =
match model.Counter with
| None -> loadCount
| _ -> msgs
#endif

#if (reaction)
Expand Down Expand Up @@ -204,7 +209,7 @@ let safeComponents =
#endif
#if (reaction)
str ", "
a [ Href "https://dbrattli.github.io/Reaction/" ] [ str "Fable.Reaction" ]
a [ Href "http://elmish-streams.rtfd.io/" ] [ str "Elmish.Streams" ]
#endif
#if (remoting)
str ", "
Expand Down Expand Up @@ -893,7 +898,7 @@ open Elmish.HMR
//+:cnd:noEmit
#if (reaction)
Program.mkSimple init update view
|> Program.withQuery query
|> Program.withStreams stream "msgs"
#else
Program.mkProgram init update view
#endif
Expand Down
2 changes: 1 addition & 1 deletion Content/src/Client/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ group Client
Fable.Elmish.Debugger
Fable.Elmish.React
//#if (reaction)
Fable.Elmish.Reaction
Fable.Elmish.Streams
//#endif
Fable.Elmish.HMR
//#if (remoting)
Expand Down
8 changes: 4 additions & 4 deletions Content/src/Client/paket_noremoting-fulma-noreaction.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NUGET
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Debugger (3.0)
Fable.Elmish.Debugger (3.0.1)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand Down Expand Up @@ -59,15 +59,15 @@ NUGET
Fable.Promise (2.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.5.2)
Fable.React (5.1)
Fable.React (5.2.3)
Fable.Browser.Dom (>= 1.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
FSharp.Core (4.6.2)
Fulma (2.0)
Fulma (2.1)
Fable.Core (>= 3.0)
Fable.React (>= 5.1)
Thoth.Json (3.0)
Thoth.Json (3.1)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)

18 changes: 9 additions & 9 deletions Content/src/Client/paket_noremoting-fulma-reaction.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ NUGET
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Debugger (3.0)
Fable.Elmish.Debugger (3.0.1)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand All @@ -48,14 +48,14 @@ NUGET
Fable.Elmish (>= 3.0)
Fable.React (>= 5.1)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Reaction (3.0)
Fable.Elmish.Streams (3.0.3)
Fable.Browser.Event (>= 1.0)
Fable.Browser.WebSocket (>= 1.0)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
Fable.React (>= 5.1)
FSharp.Control.AsyncRx (>= 1.0)
FSharp.Core (>= 4.6.2)
Reaction.AsyncRx (>= 2.1)
Fable.Fetch (2.0)
Fable.Browser.Blob (>= 1.0)
Fable.Core (>= 3.0)
Expand All @@ -71,20 +71,20 @@ NUGET
Fable.Promise (2.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.5.2)
Fable.React (5.1)
Fable.React (5.2.3)
Fable.Browser.Dom (>= 1.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
FSharp.Control.AsyncRx (1.0)
FSharp.Control.AsyncSeq (>= 2.0.21)
FSharp.Core (>= 4.5.4)
FSharp.Control.AsyncSeq (2.0.21)
FSharp.Core (>= 4.3.2)
FSharp.Core (4.6.2)
Fulma (2.0)
Fulma (2.1)
Fable.Core (>= 3.0)
Fable.React (>= 5.1)
Reaction.AsyncRx (2.1)
FSharp.Control.AsyncSeq (>= 2.0.21)
FSharp.Core (>= 4.5.4)
Thoth.Json (3.0)
Thoth.Json (3.1)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)

6 changes: 3 additions & 3 deletions Content/src/Client/paket_noremoting-nofulma-noreaction.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NUGET
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Debugger (3.0)
Fable.Elmish.Debugger (3.0.1)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand All @@ -52,12 +52,12 @@ NUGET
Fable.Promise (2.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.5.2)
Fable.React (5.1)
Fable.React (5.2.3)
Fable.Browser.Dom (>= 1.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
FSharp.Core (4.6.2)
Thoth.Json (3.0)
Thoth.Json (3.1)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)

16 changes: 8 additions & 8 deletions Content/src/Client/paket_noremoting-nofulma-reaction.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ NUGET
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Debugger (3.0)
Fable.Elmish.Debugger (3.0.1)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand All @@ -48,14 +48,14 @@ NUGET
Fable.Elmish (>= 3.0)
Fable.React (>= 5.1)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Reaction (3.0)
Fable.Elmish.Streams (3.0.3)
Fable.Browser.Event (>= 1.0)
Fable.Browser.WebSocket (>= 1.0)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
Fable.React (>= 5.1)
FSharp.Control.AsyncRx (>= 1.0)
FSharp.Core (>= 4.6.2)
Reaction.AsyncRx (>= 2.1)
Fable.Fetch (2.0)
Fable.Browser.Blob (>= 1.0)
Fable.Core (>= 3.0)
Expand All @@ -64,17 +64,17 @@ NUGET
Fable.Promise (2.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.5.2)
Fable.React (5.1)
Fable.React (5.2.3)
Fable.Browser.Dom (>= 1.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
FSharp.Control.AsyncRx (1.0)
FSharp.Control.AsyncSeq (>= 2.0.21)
FSharp.Core (>= 4.5.4)
FSharp.Control.AsyncSeq (2.0.21)
FSharp.Core (>= 4.3.2)
FSharp.Core (4.6.2)
Reaction.AsyncRx (2.1)
FSharp.Control.AsyncSeq (>= 2.0.21)
FSharp.Core (>= 4.5.4)
Thoth.Json (3.0)
Thoth.Json (3.1)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)

8 changes: 4 additions & 4 deletions Content/src/Client/paket_remoting-fulma-noreaction.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NUGET
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Debugger (3.0)
Fable.Elmish.Debugger (3.0.1)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand All @@ -56,7 +56,7 @@ NUGET
Fable.Parsimmon (4.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.React (5.1)
Fable.React (5.2.3)
Fable.Browser.Dom (>= 1.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand All @@ -70,10 +70,10 @@ NUGET
Fable.Parsimmon (>= 4.0)
FSharp.Core (>= 4.6.2)
FSharp.Core (4.6.2)
Fulma (2.0)
Fulma (2.1)
Fable.Core (>= 3.0)
Fable.React (>= 5.1)
Thoth.Json (3.0)
Thoth.Json (3.1)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)

18 changes: 9 additions & 9 deletions Content/src/Client/paket_remoting-fulma-reaction.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ NUGET
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Debugger (3.0)
Fable.Elmish.Debugger (3.0.1)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand All @@ -48,14 +48,14 @@ NUGET
Fable.Elmish (>= 3.0)
Fable.React (>= 5.1)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Reaction (3.0)
Fable.Elmish.Streams (3.0.3)
Fable.Browser.Event (>= 1.0)
Fable.Browser.WebSocket (>= 1.0)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
Fable.React (>= 5.1)
FSharp.Control.AsyncRx (>= 1.0)
FSharp.Core (>= 4.6.2)
Reaction.AsyncRx (>= 2.1)
Fable.FontAwesome (2.0)
Fable.Core (>= 3.0)
Fable.React (>= 5.1)
Expand All @@ -68,7 +68,7 @@ NUGET
Fable.Parsimmon (4.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.React (5.1)
Fable.React (5.2.3)
Fable.Browser.Dom (>= 1.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand All @@ -81,16 +81,16 @@ NUGET
Fable.Core (>= 3.0)
Fable.Parsimmon (>= 4.0)
FSharp.Core (>= 4.6.2)
FSharp.Control.AsyncRx (1.0)
FSharp.Control.AsyncSeq (>= 2.0.21)
FSharp.Core (>= 4.5.4)
FSharp.Control.AsyncSeq (2.0.21)
FSharp.Core (>= 4.3.2)
FSharp.Core (4.6.2)
Fulma (2.0)
Fulma (2.1)
Fable.Core (>= 3.0)
Fable.React (>= 5.1)
Reaction.AsyncRx (2.1)
FSharp.Control.AsyncSeq (>= 2.0.21)
FSharp.Core (>= 4.5.4)
Thoth.Json (3.0)
Thoth.Json (3.1)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)

6 changes: 3 additions & 3 deletions Content/src/Client/paket_remoting-nofulma-noreaction.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NUGET
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Debugger (3.0)
Fable.Elmish.Debugger (3.0.1)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand All @@ -49,7 +49,7 @@ NUGET
Fable.Parsimmon (4.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.React (5.1)
Fable.React (5.2.3)
Fable.Browser.Dom (>= 1.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand All @@ -63,7 +63,7 @@ NUGET
Fable.Parsimmon (>= 4.0)
FSharp.Core (>= 4.6.2)
FSharp.Core (4.6.2)
Thoth.Json (3.0)
Thoth.Json (3.1)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)

16 changes: 8 additions & 8 deletions Content/src/Client/paket_remoting-nofulma-reaction.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ NUGET
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Debugger (3.0)
Fable.Elmish.Debugger (3.0.1)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand All @@ -48,20 +48,20 @@ NUGET
Fable.Elmish (>= 3.0)
Fable.React (>= 5.1)
FSharp.Core (>= 4.6.2)
Fable.Elmish.Reaction (3.0)
Fable.Elmish.Streams (3.0.3)
Fable.Browser.Event (>= 1.0)
Fable.Browser.WebSocket (>= 1.0)
Fable.Core (>= 3.0)
Fable.Elmish (>= 3.0)
Fable.React (>= 5.1)
FSharp.Control.AsyncRx (>= 1.0)
FSharp.Core (>= 4.6.2)
Reaction.AsyncRx (>= 2.1)
Fable.Import.Browser (1.3)
Fable.Core (>= 1.3.17)
Fable.Parsimmon (4.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
Fable.React (5.1)
Fable.React (5.2.3)
Fable.Browser.Dom (>= 1.0)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand All @@ -74,13 +74,13 @@ NUGET
Fable.Core (>= 3.0)
Fable.Parsimmon (>= 4.0)
FSharp.Core (>= 4.6.2)
FSharp.Control.AsyncRx (1.0)
FSharp.Control.AsyncSeq (>= 2.0.21)
FSharp.Core (>= 4.5.4)
FSharp.Control.AsyncSeq (2.0.21)
FSharp.Core (>= 4.3.2)
FSharp.Core (4.6.2)
Reaction.AsyncRx (2.1)
FSharp.Control.AsyncSeq (>= 2.0.21)
FSharp.Core (>= 4.5.4)
Thoth.Json (3.0)
Thoth.Json (3.1)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)

0 comments on commit 23590af

Please sign in to comment.