From b47548554a5bbd0825cce20f43af1fa9cb04f50e Mon Sep 17 00:00:00 2001 From: maestrow Date: Sat, 17 Mar 2018 13:54:21 +0300 Subject: [PATCH] - update Elmish to beta; - rename library to app. --- paket.dependencies | 4 ++-- paket.lock | 26 +++++++++++++------------- src/{Library.fs => App.fs} | 5 ++--- src/FableElmReactApp.fsproj | 2 +- 4 files changed, 18 insertions(+), 19 deletions(-) rename src/{Library.fs => App.fs} (90%) diff --git a/paket.dependencies b/paket.dependencies index d50083c..a0b6bb4 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -2,6 +2,6 @@ source https://www.nuget.org/api/v2 storage: none clitool dotnet-fable nuget Fable.Core -nuget Fable.Elmish -nuget Fable.Elmish.React +nuget Fable.Elmish >= 2.0.0-beta-2 +nuget Fable.Elmish.React >= 2.0.0-beta-2 nuget Fable.Import.Browser \ No newline at end of file diff --git a/paket.lock b/paket.lock index 103a29a..16f3b38 100644 --- a/paket.lock +++ b/paket.lock @@ -20,24 +20,24 @@ NUGET Fable.Core (1.3.11) FSharp.Core (>= 4.2.3) - restriction: >= netstandard1.6 NETStandard.Library (>= 1.6.1) - restriction: >= netstandard1.6 - Fable.Elmish (1.0.1) - Fable.Core (>= 1.2.4) - restriction: >= netstandard1.6 - Fable.PowerPack (>= 1.3) - restriction: >= netstandard1.6 - FSharp.Core (>= 4.2.3) - restriction: >= netstandard1.6 - Fable.Elmish.React (1.0.1) - Fable.Core (>= 1.3.8) - restriction: >= netstandard1.6 - Fable.Elmish (>= 1.0.1) - restriction: >= netstandard1.6 - Fable.PowerPack (>= 1.3.2) - restriction: >= netstandard1.6 - Fable.React (>= 2.0) - restriction: >= netstandard1.6 - FSharp.Core (>= 4.2.3) - restriction: >= netstandard1.6 + Fable.Elmish (2.0.0-beta-2) + Fable.Core (>= 1.3.8) - restriction: >= netstandard2.0 + Fable.PowerPack (>= 1.3.4) - restriction: >= netstandard2.0 + FSharp.Core (>= 4.3.2) - restriction: >= netstandard2.0 + Fable.Elmish.React (2.0.0-beta-2) + Fable.Core (>= 1.3.8) - restriction: >= netstandard2.0 + Fable.Elmish (>= 2.0.0-beta-1) - restriction: >= netstandard2.0 + Fable.PowerPack (>= 1.3.4) - restriction: >= netstandard2.0 + Fable.React (>= 2.1) - restriction: >= netstandard2.0 + FSharp.Core (>= 4.3.3) - restriction: >= netstandard2.0 Fable.Import.Browser (1.1.1) Fable.Core (>= 1.3.7) - restriction: >= netstandard1.6 FSharp.Core (>= 4.2.3) - restriction: >= netstandard1.6 - Fable.PowerPack (1.3.5) - restriction: >= netstandard1.6 + Fable.PowerPack (1.3.5) - restriction: >= netstandard2.0 Fable.Core (>= 1.3.8) - restriction: >= netstandard1.6 Fable.Import.Browser (>= 1.0) - restriction: >= netstandard1.6 FSharp.Core (>= 4.2.3) - restriction: >= netstandard1.6 - Fable.React (2.1) - restriction: >= netstandard1.6 + Fable.React (3.0) - restriction: >= netstandard2.0 Fable.Core (>= 1.3.7) - restriction: >= netstandard1.6 Fable.Import.Browser (>= 0.1) - restriction: >= netstandard1.6 FSharp.Core (>= 4.2.3) - restriction: >= netstandard1.6 @@ -53,7 +53,7 @@ NUGET System.Reflection.TypeExtensions (>= 4.3) - restriction: && (< net45) (>= netstandard2.0) System.Runtime.Loader (>= 4.0) - restriction: && (< net45) (>= netstandard2.0) System.Security.Cryptography.Algorithms (>= 4.3) - restriction: && (< net45) (>= netstandard2.0) - FSharp.Core (4.3.4) - restriction: >= netcoreapp2.0 + FSharp.Core (4.3.4) - restriction: >= netstandard2.0 Microsoft.DiaSymReader (1.2) - restriction: >= netcoreapp2.0 Microsoft.Net.Compilers (>= 2.3) - restriction: || (>= net20) (>= netstandard1.1) NETStandard.Library (>= 1.6.1) - restriction: && (< net20) (>= netstandard1.1) diff --git a/src/Library.fs b/src/App.fs similarity index 90% rename from src/Library.fs rename to src/App.fs index a7e9809..3b7a1f2 100644 --- a/src/Library.fs +++ b/src/App.fs @@ -21,8 +21,7 @@ let init() : Model = 0 // UPDATE -let update msg (model:Model) = - match msg with +let update (model:Model) = function | Increment -> model + 2 | Decrement -> model - 2 @@ -32,7 +31,7 @@ module R = Fable.Helpers.React // VIEW (rendered with React) -let view model dispatch = +let view dispatch model = R.div [] [ R.button [ OnClick (fun _ -> dispatch Decrement) ] [ R.str "-" ] diff --git a/src/FableElmReactApp.fsproj b/src/FableElmReactApp.fsproj index 2635dd1..d15c27e 100644 --- a/src/FableElmReactApp.fsproj +++ b/src/FableElmReactApp.fsproj @@ -4,7 +4,7 @@ netstandard2.0 - + \ No newline at end of file