Skip to content

Implement auto refresh of items on the frontend #68

Closed
campb303 opened this issue Oct 16, 2020 · 6 comments
Closed

Implement auto refresh of items on the frontend #68

campb303 opened this issue Oct 16, 2020 · 6 comments
Assignees
Labels
feature-request Request for functionality that has not already been implemented

Comments

@campb303
Copy link
Collaborator

At the moment, the data in the ItemTable only loads when the App component is rendered which is equivalent to a full page refresh. This data should be refreshed after a fixed amount of time.

@campb303 campb303 added enhancement Request for a change to existing functionality frontend labels Oct 16, 2020
@campb303 campb303 added this to the v1 milestone Oct 16, 2020
@campb303
Copy link
Collaborator Author

campb303 commented Jan 5, 2021

This depends on #123

@campb303
Copy link
Collaborator Author

campb303 commented Feb 5, 2021

This does not depends on #123 and can be implemented with a timer function being attached to the ItemTable data fetch.

@campb303 campb303 modified the milestones: v1-proof-of-concept, v2-production-ready-read-only Feb 5, 2021
@campb303 campb303 removed the frontend label Mar 17, 2021
@campb303
Copy link
Collaborator Author

A significant refactoring of webqueue2 needs to take place to allow for compassable components which allow state to be managed in a singular location and reduces re-renders/updates. Updating the data of the ItemTable cannot happen right now without causing significant re-rendering issues. However, if/when the composition refactoring happens, below is a sketch for a design of how to implement an auto refresh action in the UI:

image

@campb303 campb303 added feature-request Request for functionality that has not already been implemented and removed enhancement Request for a change to existing functionality labels Mar 29, 2021
@campb303 campb303 removed this from the v2-production-ready-read-only milestone Mar 29, 2021
@campb303
Copy link
Collaborator Author

campb303 commented Jul 6, 2021

A timer function should be added as a useEffect callback in the component that fetches the table data.

@campb303
Copy link
Collaborator Author

campb303 commented Aug 2, 2021

A setTimeout can be called inside a useEffect as long as a function to clear the timeout is returned:

useEffect(
  const timer = setTimeout(() => console.log("Hello, World!"), 3000);
  return () => clearTimeout(timer);
);

@campb303
Copy link
Collaborator Author

campb303 commented Aug 2, 2021

Added in #227

@campb303 campb303 closed this as completed Aug 2, 2021
Sign in to join this conversation on GitHub.
Labels
feature-request Request for functionality that has not already been implemented
Projects
None yet
Development

No branches or pull requests

2 participants