Skip to content

Commit 92cb30f

Browse files
committed
Fixup WPF sample
1 parent e775f69 commit 92cb30f

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

Samples/TestBed.WPF/MainWindow.xaml.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,26 @@ public MainWindow() : base(App.Runtime)
3131
/// Register the window events
3232
/// </summary>
3333
Eff<MinRT, Unit> startup =>
34-
from _1 in tickIO.Fork()
35-
from _2 in (onMouseMove | Proxy.repeat(showMousePos)).RunEffect().Fork()
34+
from _1 in tickIO.ForkIO().As()
35+
from _2 in (onMouseMove | Proxy.repeat(showMousePos)).RunEffect().ForkIO()
3636
select unit;
3737

3838
/// <summary>
3939
/// Infinite loop that ticks every second
4040
/// </summary>
4141
Eff<MinRT, Unit> tickIO =>
4242
from _1 in modifyCount(x => x + 1)
43-
from _2 in post(setContent(CounterButton, $"{count}"))
43+
from _2 in postIO(setContent(CounterButton, $"{count}"))
4444
from _3 in waitFor(1)
4545
from _4 in tickIO // tail(tickIO)
4646
select unit;
4747

4848
Consumer<MouseEventArgs, Eff<MinRT>, Unit> showMousePos =>
4949
from e in Proxy.awaiting<MouseEventArgs>()
50-
from _ in post(from p in getPosition(e)
51-
from x in setContent(CursorTextBoxX, $"X: {p.X:F0}")
52-
from y in setContent(CursorTextBoxY, $"Y: {p.Y:F0}")
53-
select unit)
50+
from _ in postIO(from p in getPosition(e)
51+
from x in setContent(CursorTextBoxX, $"X: {p.X:F0}")
52+
from y in setContent(CursorTextBoxY, $"Y: {p.Y:F0}")
53+
select unit)
5454
select unit;
5555

5656
/// <summary>
@@ -64,7 +64,7 @@ void ButtonOnClick(object? sender, RoutedEventArgs e) =>
6464
/// </summary>
6565
Eff<MinRT, Unit> buttonOnClickIO =>
6666
from _1 in resetCount
67-
from _2 in post(setContent(CounterButton, $"{count}"))
67+
from _2 in postIO(setContent(CounterButton, $"{count}"))
6868
select unit;
6969

7070
/// <summary>

Samples/TestBed.WPF/WindowIO.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected override void OnClosed(EventArgs e)
5050
/// Useful for wrapping IO event-handlers into a Task base event-handler
5151
/// </remarks>
5252
protected void handle<A>(Eff<RT, A> operation) =>
53-
operation.Fork().Run(Runtime, EnvIO).ThrowIfFail();
53+
operation.ForkIO().Run(Runtime, EnvIO).ThrowIfFail();
5454

5555
/// <summary>
5656
/// Helper IO for setting control text
@@ -84,5 +84,5 @@ from result in queue
8484
/// Async delay
8585
/// </summary>
8686
protected static Eff<RT, Unit> waitFor(double ms) =>
87-
yield(ms);
87+
yieldIO(ms);
8888
}

0 commit comments

Comments
 (0)