aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Application/IStateMonitor.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-08-01 22:46:52 -0500
committerJP Dillingham <jpdillingham@gmail.com>2021-08-01 22:46:52 -0500
commita0176d5ae8c03624b5dbbf2d9689993db6878def (patch)
treebc528eb23bf1cc9175596d8666b27bd97e153d1b /src/slskd/Application/IStateMonitor.cs
parentd1db63a44827d928121be84479e5a22864107881 (diff)
downloadslskd-a0176d5ae8c03624b5dbbf2d9689993db6878def.tar.gz
make StateMonitor generic
Diffstat (limited to 'src/slskd/Application/IStateMonitor.cs')
-rw-r--r--src/slskd/Application/IStateMonitor.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/slskd/Application/IStateMonitor.cs b/src/slskd/Application/IStateMonitor.cs
index e4c8fc26..e36d083d 100644
--- a/src/slskd/Application/IStateMonitor.cs
+++ b/src/slskd/Application/IStateMonitor.cs
@@ -22,25 +22,25 @@ namespace slskd
/// <summary>
/// Used for notifications when <see cref="State"/> changes.
/// </summary>
- public interface IStateMonitor
+ public interface IStateMonitor<T>
{
/// <summary>
/// Gets the current application state.
/// </summary>
- State Current { get; }
+ T Current { get; }
/// <summary>
- /// Registers a listener to be called whenever <see cref="State"/> changes.
+ /// Registers a listener to be called whenever <see cref="T"/> changes.
/// </summary>
/// <param name="listener">Registers a listener to be called whenver state changes.</param>
/// <returns>An <see cref="IDisposable"/> which should be disposed to stop listening for changes.</returns>
- IDisposable OnChange(Action<(State Previous, State Current)> listener);
+ IDisposable OnChange(Action<(T Previous, T Current)> listener);
/// <summary>
/// Replaces the current state with the value resolved by the <paramref name="setter"/>.
/// </summary>
/// <param name="setter">Given the current state, resolves a new state value.</param>
/// <returns>The updated state.</returns>
- State Set(Func<State, State> setter);
+ T Set(Func<T, T> setter);
}
}