-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: allow users to provide String and Data values directly #94
Conversation
There is a lot of repeated code in these functions that I think you can factor out and DRY up quite a bit. For example, the |
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.
|
||
protocol CacheClientProtocol: ControlClientProtocol & DataClientProtocol {} | ||
|
||
extension CacheClientProtocol { |
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.
protocol extension was re-added because default parameter values didn't work correctly in tests that expected CacheClientProtocol object instead of just CacheClient
Addresses #82
The DataClient still uses the ScalarType enum internally, but the CacheClient provides public-facing methods that accept String and Data values directly. Requires overloading a bunch of functions (for example,
set
has 4 signatures now), but this was the most straightforward way I could think to implement this at the moment.Removed the CacheClient protocol and DataClientProtocol extension along the way; I thought it would make more sense for the CacheClient to be its own separate public-facing interface rather than have its type be a union of the ControlClientProtocol and DataClientProtocol.
Open to suggestions / other ideas here though!