Skip to content
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

add getAllKeys and removeItem #5

Merged
merged 7 commits into from
Feb 6, 2017
Merged

Conversation

nhayfield
Copy link
Contributor

added these methods in an attempt to integrate with redux-persist. still working on integrating but these appear to be working as intended for now.

@rt2zz
Copy link

rt2zz commented Feb 3, 2017

🎈 this would be excellent! The built in AsyncStorage has significant limitations as you know. Is there anything I can do to help?

@nhayfield
Copy link
Contributor Author

nhayfield commented Feb 3, 2017

@rt2zz I'm not really a java developer, been about 5 years since i have looked at it. so i was just winging it on this one. might be an issue with the callbacks being required so maybe i need to add some overloaded methods with only one input and no callbacks. not too sure. its pretty close to working but not sure where to go from here. Is all that is required to implement the four methods setItem, getItem, removeItem, and getAllKeys and then pass them in? or would i need to add support in redux-persist too?

public void removeItem(String key, Callback successCallback) {
SharedHandler.init(getReactApplicationContext());
SharedDataProvider.deleteSharedValue(key);
successCallback.invoke(key);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need callback for the removeItem? It will always give success right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sriraman good point i can remove it

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the change myself in the master branch.

@sriraman sriraman merged commit 2443334 into sriraman:master Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants