Skip to content

Commit 4d2cafb

Browse files
committed
v1.0.0-beta.4 - replaced SourceList.clear with SourceList.removeAll
1 parent ba071fe commit 4d2cafb

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/ReactiveElmish.Avalonia/ReactiveElmish.Avalonia.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1818
<PackageProjectUrl>https://github.com/JordanMarr/ReactiveElmish.Avalonia</PackageProjectUrl>
1919
<PackageTags>Avalonia F# fsharp Elmish Elm</PackageTags>
20-
<Version>1.0.0-beta.3</Version>
20+
<Version>1.0.0-beta.4</Version>
2121
<!--Turn on warnings for unused values (arguments and let bindings) -->
2222
<OtherFlags>$(OtherFlags) --warnon:1182</OtherFlags>
2323
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>

src/ReactiveElmish/DynamicData.fs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@ module SourceList =
2525
sourceList.Remove item |> ignore
2626
sourceList
2727

28-
let clear<'T> (sourceList: SourceList<'T>) =
29-
sourceList.Clear()
28+
// Removed because it would cause list to permanently disappear (unsubscribe maybe?).
29+
//let clear<'T> (sourceList: SourceList<'T>) =
30+
// sourceList.Clear()
31+
// sourceList
32+
33+
let removeAll<'T> (sourceList: SourceList<'T>) =
34+
for item in sourceList.Items do
35+
sourceList.Remove item |> ignore
3036
sourceList
3137

3238
/// Functional helpers for DynamicData.SourceCache.

src/Samples/AvaloniaExample/ViewModels/ChartViewModel.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ module Chart =
112112
{ model with
113113
// deactivate the AutoUpdate ToggleButton in the UI
114114
IsAutoUpdateChecked = false
115-
Actions = model.Actions |> SourceList.clear |> SourceList.add { Description = "Reset Chart"; Timestamp = DateTime.Now }
115+
Actions = model.Actions |> SourceList.removeAll |> SourceList.add { Description = "Reset Chart"; Timestamp = DateTime.Now }
116116
}
117117
| SetIsAutoUpdateChecked isChecked ->
118118
{ model with

src/Samples/AvaloniaExample/ViewModels/CounterViewModel.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module Counter =
3636
| Reset ->
3737
{
3838
Count = 0
39-
Actions = model.Actions |> SourceList.clear |> SourceList.add { Description = "Reset"; Timestamp = DateTime.Now }
39+
Actions = model.Actions |> SourceList.removeAll |> SourceList.add { Description = "Reset"; Timestamp = DateTime.Now }
4040
}
4141

4242
open Counter

0 commit comments

Comments
 (0)