rx-preferences icon indicating copy to clipboard operation
rx-preferences copied to clipboard

Add MemoryPreference artifact?

Open NightlyNexus opened this issue 6 years ago • 5 comments

I have rewritten MemoryPreference a few times in various projects for tests and mock mode.

public final class MemoryPreference<T> implements Preference<T> {
  private final String key;
  private final T defaultValue;
  @Nullable private volatile T value;
  ...
}

Maybe there should be an artifact here for it?

NightlyNexus avatar Mar 13 '18 06:03 NightlyNexus

Is there a strong reason to prefer a memory backed preference over just a normal preference?

f2prateek avatar Apr 22 '18 17:04 f2prateek

Actually, I guess it might make sense if you're not using Robolectric.

f2prateek avatar Apr 22 '18 17:04 f2prateek

Yes, I don't use Robolectric.

NightlyNexus avatar Apr 22 '18 21:04 NightlyNexus

@NightlyNexus show full code, please =)

MrVilkaman avatar Apr 28 '18 03:04 MrVilkaman

Is this still on the table? I basically have a small test class that i end up copying in every project I use this library in. Would be nice to have an official artifact. Happy to contribute a PR or continue on the existing one

ShaishavGandhi avatar Dec 26 '19 01:12 ShaishavGandhi