-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(types): provide simplistic storage interfaces #436
fix(types): provide simplistic storage interfaces #436
Conversation
The web example with I experimented with building upon the generics, which could actually perform the type-check against the provided |
1b6a249
to
ecb0a41
Compare
Left comments on other PR..What is the relation between them |
ecb0a41
to
3f30b4b
Compare
fix apollographql#426, fix apollographql#431 by adding support for new synchronous removeItem
3f30b4b
to
56b1c55
Compare
@wtrocki uploaded the changes as discussed in #437 This also includes the MMKV compatibility fix, since I needed to match the actual interface (the change is already bringing fruits :D ). I haven't tested this, so please if anyone can give it a try - I'll not be able to test at least until tomorrow, but at the same time, I didn't want to stall this. LocalStorage should be simple to test using the web example, the I'd like to test at least LocalForage since it's slightly unusual & AsyncStorage as a popular RN choice. |
Ok to merge this? Does that compile for web example? |
Sorry, just got to test this. Unfortunately, this doesn't fix the issue 😢 . The problem is in the generics - we only type-check what the storage wrapper can accept. But the rest of the persistor is still passing around What needs to be done is that based on the I've updated most of the types now to carry the information, but I'm missing some bit somewhere... Not ready to merge, sorry. |
Ok, I think I fixed it. Tested both web and react-native examples and all seems to be working.
@wtrocki Please do if you approve my changes - I'm ok with merging this now. |
Verified web only. Looks like it is working |
Provide an interface for each wrapper, which captures the required subset of the actual expected storage.
Also, added support for MMKV storage v0.5.7+ in the process.
fix #426, #431