-
Notifications
You must be signed in to change notification settings - Fork 466
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
[v2] Web Storage #216
[v2] Web Storage #216
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far so good - left few commnets. I'm going to revisit this PR later today
@JesseRWeigel On the second thought, it's a lot to tackle at once: Storage, Example and Docs. Let's keep this PR with only Storage implementation and tests for it - let's leave other two for separate PRs. |
@krizzu Good idea! I will keep everything in separate PRs. |
@krizzu I removed the example app and finished the unit tests for local and session storage. Everything is working, but I have a few type errors that I haven't been able to resolve. Any assistance with the type errors that you could provide would be greatly appreciated.
It seems like the first two type errors are related to the third one, and would be resolved along with it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work so far 💪
Your issues comes from the wrongly typed Storage - I've left comments to help you find them.
Also, I see that we need to change TS settings - each package should have its own tsconfig
, extending the main one. I'm going to fix this one once you're done with requested changes.
@JesseRWeigel Sorry for late response. I've pushed a commit, that includes few changes to packages - this makes each of them an independent projects. What's left to do here are typing of Storage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're almost there 💪
Please pull the changes I committed and look through comments I left for you.
If you need more help, just ask
@JesseRWeigel Great work, thanks a lot! |
Summary:
#52
I added a web-storage option that uses localStorage(default) or sessionStorage(by passing true as the first param when creating a Webstorage instance).
I also added a react app as an example to demonstrate using Webstorage. I followed the same UI structure as the React Native example app.
Test Plan:
You can test Webstorage by running
yarn start
from theexamples/web
folder. To use sessionStorage instead of localStorage, pass intrue
as the first parameter toWebStorage()
instorage.js
in theweb
folder.const web = new WebStorage(true);
There are still some things that should be done:
Also, I am not very familiar with Typescript, so I expect that there may be some issues with how I implemented it.