ivoleitao / stash

Key-value store abstraction with plain and cache driven semantics and a pluggable backend architecture.
MIT License
82 stars 16 forks source link

Make `get` sync #65

Closed clragon closed 6 months ago

clragon commented 9 months ago

Is your feature request related to a problem? Please describe. Retrieving values from a store through async means makes everything in flutter 4 times more complicated

Describe the solution you'd like Just like shared preferences and many other storage solutions, a Vault could memory cache its current value. Because initialising a Vault already requires an async operation, this is the perfect place to get the first value. After that, the Vault can update its value under the hood whenver an event arrives.

Describe alternatives you've considered I can cook up my own solution that is sync

Additional context The intialize async once, use sync mechanism could be a great improvement over the always async approach. It would allow us to make Settings classes which need only be initialized once in main, then can be used fully synchronously for the rest of the runtime.

github-actions[bot] commented 8 months ago

Issue had no activity in the last 30 days. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 8 months ago

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] commented 7 months ago

Issue had no activity in the last 30 days. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 6 months ago

This issue was closed because it has been stalled for 5 days with no activity.