Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Remove shared preferences as a hard dependency #30

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

venkatd
Copy link

@venkatd venkatd commented Jul 9, 2021

@robertohuertasm I haven't been able to run the tests because I couldn't generate the mocks, but thought I'd submit a draft PR on how I might propose the change.

I haven't dropped share_preferences as a dependency, but for now I've introduced a StringCache abstraction that defaults to in-memory. I've also implemented a SharedPreferencesStringCache to show how we could still use SharedPreferences if we want to.

I'm not sure if we'd want to:

  • Pull out a separate package for shard_preferences related stuff
  • or share in the README.md how a user of this library may opt into using shared preferences with a code snippet. (My preference would be this because the implementation is so tiny.)

One advantage is that we no longer need to mock SharedPreferences for the tests. The default in-memory cache will run with no problem.

Meant to resolve #29

…aches

Removed mocking of this cache in the tests
TODO: extract shared preferences cache into its own package or put it in the README how to use it
@tsimbalar
Copy link

Really sorry, but we are no longer maintaining the repository. We will archive it shortly

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SharedPreferences as an optional dependency
2 participants