riverpod
riverpod copied to clipboard
Let `Storage.inMemory` accept a map for initial test/mock data
Currently, Storage.inMemory() does not take any parameters.
The constructor is useful for tests, as it does not require a real backend.
However, If you wanted to ensure that some data was already saved, you'd be forced to manually write it before returning the object.
It would be really nice if we could specify "initial data" for certain tests
You can use ..
Storage.inMemory()..write(key, value)..write(key,value)
Not planned for now.
The reason is options (such as destroyKey and co). The syntax wouldn't be very convenient when .. already exists