Support in ISessionStorage methods promises
See original GitHub issueAt the moment ISessionStorage
methods do not support returning session data asynchronously.
It would be good if the implementation can be updated to also allow return Promises with session data as otherwise in react-native it’s not possible to provide custom sessionStorage
as the default AsyncStorage
in RN is asynchronous by nature.
If that sounds good let me know I can push an update to the codebase.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
A Practical Guide to JavaScript sessionStorage
In this tutorial, you'll learn how to use the JavaScript sessionStorage to store data only for a session.
Read more >Window.sessionStorage - Web APIs - MDN Web Docs
The read-only sessionStorage property accesses a session Storage object for the current origin. sessionStorage is similar to localStorage ...
Read more >Working with SessionStorage | Learn ECMAScript
Let's now quickly go over all the methods of session storage. Creating a session storage entry. To create a key-value pair inside the...
Read more >$sessionStorage should return a promise · Issue #185 - GitHub
if $sessionStorage returns before saving the sessionStorage in the browser then we need callback to execute code that relies on sessionStorage.
Read more >Is any solution to do localstorage setItem in asynchronous way ...
Yes. But this code is synchronous. The methods return a promise but not before the local storage action has completed. – trincot. Jul...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah exactly it would require a static async init method, I intend to include a lot of breaking changes with v2.0 so I will make sure to make store async
Damn I just looked through it and there is a breaking change with this feature which will break how sessions are currently recovered from the connector constructor which needs to be synchronous
I would totally make this change if it didn’t break existing integrations.
You can however still implement it on top where you can store WalletConnect sessions mapped by the clientId or peerId (both are unique per session). Here is the example for our react-native demo app.
https://github.com/WalletConnect/walletconnect-demo-app/blob/master/src/helpers/asyncStorage.ts#L44