Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Elmish.WPF.Tests/DynamicViewModelTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ module Helpers =
AutoRequery = autoRequery }
|> CmdData
|> BaseBindingData
|> createBinding) name
|> Binding.createBinding) name


let internal subModel
Expand Down
8 changes: 6 additions & 2 deletions src/Elmish.WPF/Binding.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ open Elmish
module Binding =
open BindingData

let internal createBinding data name =
{ Data = data
Name = name }

let internal mapData f binding =
{ Name = binding.Name
Data = binding.Data |> f }
{ Data = binding.Data |> f
Name = binding.Name }

/// Maps the model of a binding via a contravariant mapping.
let mapModel (f: 'a -> 'b) (binding: Binding<'b, 'msg>) = f |> mapModel |> mapData <| binding
Expand Down
4 changes: 0 additions & 4 deletions src/Elmish.WPF/DynamicViewModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ type Binding<'model, 'msg> =
[<AutoOpen>]
module internal Helpers =

let createBinding data name =
{ Name = name
Data = data }

type SubModelSelectedItemLast with
member this.CompareBindings() : Binding<'model, 'msg> -> Binding<'model, 'msg> -> int =
fun a b -> this.Recursive(a.Data) - this.Recursive(b.Data)
Expand Down