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

Soft reload playlist #77

Open
Noam-Bendelac opened this issue Jan 10, 2021 · 1 comment
Open

Soft reload playlist #77

Noam-Bendelac opened this issue Jan 10, 2021 · 1 comment
Labels
enhancement New feature or request frontend Frontend functionality
Milestone

Comments

@Noam-Bendelac
Copy link
Collaborator

On playlist update / on interval (also for other resource if necessary). On/before fetch start, keep the old value of the resource and set loading to true, then when fetch is done set loading to false and update the data value.

I thought I would have to refactor the Resource interface for this, but now I don't think I do; I just need to update the uses of resource instances.

@Noam-Bendelac Noam-Bendelac added enhancement New feature or request frontend Frontend functionality labels Jan 10, 2021
@Noam-Bendelac Noam-Bendelac added this to the Milestone 2 milestone Jan 10, 2021
@Noam-Bendelac
Copy link
Collaborator Author

While I'm at it, I will remove the updateResource function and just return a normal setter from useResource. All uses of the resource setter should be changed to use React setter function syntax and object spread like the current implementation of updateResource:

setResource(resource => ({
  ...resource,
  ...updates,
}))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Frontend functionality
Projects
None yet
Development

No branches or pull requests

1 participant