react-native-storage icon indicating copy to clipboard operation
react-native-storage copied to clipboard

Added concurrency limiter

Open kevinejohn opened this issue 4 years ago • 5 comments

Fixes this issue: https://github.com/sunnylqm/react-native-storage/issues/245

https://github.com/facebook/react-native/issues/27483

kevinejohn avatar Apr 13 '20 00:04 kevinejohn

Maybe use multiGet is a better way?

sunnylqm avatar Apr 13 '20 02:04 sunnylqm

Are you saying call storage.getIdsForKey and then batch multiGet in smaller amounts?

kevinejohn avatar Apr 13 '20 02:04 kevinejohn

Yes in that way there would be only one promise.

sunnylqm avatar Apr 13 '20 02:04 sunnylqm

Unfortunately window.localStorage does not have that same multiGet function which would break the cross platform compatibility of this library. Any other ideas?

kevinejohn avatar Apr 13 '20 03:04 kevinejohn

Make it conditional (use multiGet only if it's available)

sunnylqm avatar Apr 13 '20 03:04 sunnylqm