Comments (5)
I say let's try to get everything out the door for Release v1.1.0 and then maybe we can do a better job with all of this. If we can patch/hug this issue for now, I will be happy with it. I would be glad to do a react milestone after this, and the codebase will become a lot more flexible at that point.
from pokenurse.
It looks to me like we are telling the server to change the favorite status and updating the UI without updating the state. Which is the wrong way to the think about it in my opinion.
Ideally we should be managing the local state and the UI should be responding to those changes.
Storing the state in local storage is fine (we could even write to disk using the fs
module). Although that would fix the issue, it would require us to re-render the entire list.
- User clicks Favorite UI which is in state
false
- Update local Favorite State to
true
and Render Favorite UI change - Send Request
- Success
- Update local Favorite State
true
and Render Favorite UI change
- Update local Favorite State
- Error
- Update local Favorite State
false
and Render Favorite UI change
- Update local Favorite State
- Success
In this scenario our state is our pokemon monsters object. If we switched to React this scenario would be a lot simpler for me to wrap my head around. Let me think on it some more. Do you agree with my thoughts above? Do you see an error in the logic?
from pokenurse.
You're on the money. I just haven't written a lot of JS period so it's all new to me.. I'm onboard with React, but you're obviously going to have to get us started down that road.
Prioritize bugs and not take on new features if we're going to go towards React.
from pokenurse.
@mackhankins I tested my fix, and am curious what you think of it. Since you reproduced the issue, I'd like confirmation that it actually fixes it :P
from pokenurse.
Good job. Tested and working.
from pokenurse.
Related Issues (20)
- Error HOT 1
- [Feature request] Improving Rename function with a Bulk Action
- store hash key across launches HOT 2
- Can't login HOT 1
- Hastag Key Required? HOT 3
- Bad request to hashing server (expired key) HOT 10
- Problem With login. HOT 5
- incorrect monster name on candies HOT 2
- [Feature Request] Export to CSV
- [Feature Request] display max CP in power up hover.
- missing evolution options - Chansey & Golbat
- questions about the candy cost to power up
- Issue Apppasswords? HOT 1
- A few issues HOT 10
- Getting 403; not using 2-factor HOT 1
- Is there anyway to use poke nurse without hashing key? HOT 2
- [Linux] desktop file is lacking a Categories= entry
- Login Error getaddrinfo HOT 1
- Dead Project? HOT 1
- Working alternatives to PokeNurse? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pokenurse.