-
Notifications
You must be signed in to change notification settings - Fork 68
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
feat!(Stores): Category ctors take name + caching argument goes last #410
Conversation
d830c57
to
b8e8d04
Compare
if act <> null then act.AddStream(categoryName, streamId, streamName).AddSyncAttempt(attempt) |> ignore | ||
if act <> null then act.AddStream(name, streamId, streamName).AddLeader(requireLeader).AddStale(maxAge) |> ignore | ||
return! inner.Load(log, name, streamId, streamName, maxAge, requireLeader, ct) } | ||
member _.Sync(attempt, token, originState, events, ct) = task { |
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.
Ooh, I love the rebrand <3
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.
Yeah, I just wanted to Synchronize on terse naming. All I need is a Async.hronously
and all my code will be very golfy
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.
module Async =
let heinously a = Async.RunSynchronously(a)
let hronously ct a = Async.Start(a, ct)
I'm so here for this 🍿
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.
🤣
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.
This is awesome!
Rename TrySync -> Sync
0b6f417
to
6daad6d
Compare
Following @nordfjord and @everzet's leadership in equinox-project/equinox-js#6
*StoreCategory
types now have aName
as a second argument rather than having it littering theDecider.resolve
partial application chain.caching
argument moves to the end of the constructor argument list, to reflect that Caching, which was once a store-specific integration, is now a fairly separable decorator (one can imagine adjusting it so that it gets applied independent of theCategory
construction at some point)IME This has made factory wiring in apps much more terse, with less juggling of compiler errors, and also removes the ugly temporary
Equinox.Factory
name, so I trust that on balance this is a good change