add AsyncStorage.setBackend to support custom backends#11972
add AsyncStorage.setBackend to support custom backends#11972mvayngrib wants to merge 1 commit intofacebook:masterfrom
Conversation
There was a problem hiding this comment.
null: Parsing error: Unexpected token
1 |
2 | export type AsyncStorageBackend = {
3 | clear: function,
| ^
4 | getAllKeys: function,
5 | multiGet: function,
6 | multiSet: function,
ded3be6 to
a835158
Compare
|
not sure why tests failed, the errors seem to point to Alert.js, which I did not modify: |
There was a problem hiding this comment.
@mkonicek nothing changed in this respect, this is old code
There was a problem hiding this comment.
What about the other methods such as getAllKeys?
There was a problem hiding this comment.
@mkonicek same as above. I don't want to mix a bunch of different changes in one PR
|
To fix the tests you probably just need to rebase. |
|
@mkonicek re: rebase, great, will do in a bit |
a835158 to
937171c
Compare
|
@mkonicek checks don't seem to be moving :) |
|
@mkonicek any hope for this PR? |
|
@mvayngrib I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
Q: What existing problem does the pull request solve?
A: I want to use a custom backend for AsyncStorage, specifically: https://www.npmjs.com/package/react-native-async-storage-snappy on Android and https://www.npmjs.com/package/react-native-async-storage-rocks on iOS
The latter doesn't require any changes because it anticipates the presence check for a native module called AsyncRocksDBStorage, but the former is currently impossible without ugly tricks like NativeModules.AsyncRocksDBStorage = NativeModules.AsyncSnappyStorage
the change is pretty small (mainly the setBackend method itself and the addition of AsyncStorageTypes.js). It looks big because I had to move out mergeItem and multiMerge from the AsyncStorage object