Skip to content

Commit b4fd825

Browse files
[feat]: Updated XML docs; changed Curr property to Value for clarity.
what changed?: more xml docs and change Curr property to Value for more familiar usage why?: doing x.Curr makes less sense than doing x.Value effect?: n/a
1 parent aeb607c commit b4fd825

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/SAFE.Client/SAFE.fs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,21 +188,23 @@ module RemoteData =
188188
let startLoading (remote: RemoteData<'T>) = remote.StartLoading
189189
190190
///A type which represents optimistic updates.
191-
type Optimistic<'a> = {
192-
Prev: 'a option
193-
Curr: 'a option
191+
type Optimistic<'T> = {
192+
/// The previous value, if any
193+
Prev: 'T option
194+
/// The current value, if any
195+
Value: 'T option
194196
}with
195197
196-
///Assign the current value as the now previous value and the passed in value as the new current value
198+
/// Updates the current value, shifting the existing current value to previous.
197199
member this.Update value =
198200
{
199-
Curr = Some value
200-
Prev = this.Curr
201+
Value = Some value
202+
Prev = this.Value
201203
}
202204
203-
///Rollback to the previous value in the case of a failure
204-
member this.Rollback =
205+
/// Rolls back to the previous value, discarding the current one.
206+
member this.Rollback () =
205207
{
206-
Curr = this.Prev
208+
Value = this.Prev
207209
Prev = None
208210
}

0 commit comments

Comments
 (0)