Skip to content
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

Merged
merged 6 commits into from
Jul 26, 2023

Conversation

bartelink
Copy link
Collaborator

@bartelink bartelink commented Jul 25, 2023

Following @nordfjord and @everzet's leadership in equinox-project/equinox-js#6

  • all *StoreCategory types now have a Name as a second argument rather than having it littering the Decider.resolve partial application chain.
  • the 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 the Category 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

@bartelink bartelink changed the title Categories have Names feat: Categories have Names Jul 25, 2023
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 {
Copy link
Contributor

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

Copy link
Collaborator Author

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

Copy link
Contributor

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 🍿

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣

Copy link
Contributor

@nordfjord nordfjord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome!

@bartelink bartelink changed the title feat: Categories have Names BREAKING: Categories have Names Jul 26, 2023
@bartelink bartelink changed the title BREAKING: Categories have Names feat!(Stores): Category ctors take name + caching argument goes last Jul 26, 2023
@bartelink bartelink merged commit ef1ca1e into master Jul 26, 2023
5 checks passed
@bartelink bartelink deleted the cats-have-names branch July 26, 2023 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants