-
Notifications
You must be signed in to change notification settings - Fork 1
Add a new helper type for SAFE.Client: Optimistic
#12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…frontend development. what changed?: add new helper client types for optimistic update why?: aid in front end development effect?: n/a
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
Interesting addition, curious to see it in action! A few pieces of feedback:
|
…based on PR feedback. what changed?: added tests for Optimistic helper type; Also added utility functions for Optimistic helper type why?: from pr feedback effect?: better tested library
what changed?: opt in for a DU instead of a record type for Optimistic helper type why?: make illegal states unrepresentable effect?: n/a
|
||
///A type which represents optimistic updates. | ||
type Optimistic<'T> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like the case names could perhaps be clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be represented as an option instead? like
type Optimistic<'T> = (current: 'T * previous: 'T option) option
|
||
/// Rolls back to the previous value, discarding the current one. | ||
member this.Rollback () = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
member this.Rollback () = | |
member this.RollBack () = |
"Rollback" is a noun, "roll back" is the verb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly prefer Rollback
Co-authored-by: Matt Gallagher <[email protected]>
@arpxspace All actual code for this project has been moved to SAFE.Utils. Can you move this PR there? |
supports frontend development.
what changed?: add new helper client types for optimistic update
why?: aid in front end development
implements #11