Support getting the current value
kettanaito opened this issue · 2 comments
kettanaito commented
Need to implement an API to return the current value of the storage.
Suggestion
const store = new LiveStorage(...)
store.getValue() // or
store.current() //
Aprillion commented
store.value
is currently public - is that intended, or to be replaced by a private member and a getter method?
kettanaito commented
@Aprillion I think it's better to have a designated getter, even if it will mirror the internal value
property. That'd give us more control over the value returned and save the users from potential internal breaking changes that we would be able to handle in the designated getter.
At the same time, the current value
property must be marked as private.