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

Shuttle card breakout #45

Merged
merged 9 commits into from
Sep 28, 2016
Merged

Shuttle card breakout #45

merged 9 commits into from
Sep 28, 2016

Conversation

srkirkland
Copy link
Contributor

@a6wu Pretty big refactor of Shuttle Card out of Home.js. Could still use some work to update the logic to allow a different number of shuttles than just two and other features, but I think it works as well or better than the old one. It is a bit different because of a few reasons:

  • doesn't load until an actual location is found. Maybe we'll want to change it to use a default location but I do not think that should be the card's concern, and also I don't think it should be hardcoded anyway.
  • card now updates when the this.state.currentPosition changes lat/lng. Depending on how agressively you are tracking the user's location in the future we might want to meter/debounce this but for now it's pretty cool.
  • uses setInterval() for a timer which seems to work very well, instead of the old mixin.

pretty much closes #30

@c3bryant c3bryant merged commit 0fb3562 into UCSD:dev Sep 28, 2016
@i8wu
Copy link
Collaborator

i8wu commented Sep 28, 2016

Since the card now refreshes on location change and on an interval we may want to change logic so Home.js refreshAllCards() isn't also refreshing it. Will take a look when I've got a bit more time. @c3bryant thoughts?

@c3bryant
Copy link
Contributor

@i8wu after v2.3 it might be a good time to revisit building a Feed Manager of sorts that all views use, leveraging AsyncStorage to keep track of feeds/timestamps so we can use caching and have an overall better handle on what/when which feeds are being refreshed

@jpknoll
Copy link
Contributor

jpknoll commented Sep 29, 2016

@c3bryant Disagree re: global feed manager. Cards can/should manage their own data access via a thin service layer. If you want caching, it should be implemented there.

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.

Refactor Shuttle out of Home.js
4 participants