jChicote / jChicote/Asteroid_Visualizer
Implement a data loader
- Dominant language
- JavaScript
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Description
Preloading all the data will not be optimal with the magnitude of asteroids and planet data that will be loaded from the API. On a slow connection, pre-loading all this data may even exceed 3 or 5 minutes. Therefore, a dataloader factory will be created to produce the data loading mechanism to get the data from the API.
## Acceptance Criteria
- Data can be loaded on demand and when necessary
- Factory can load the data when needed
- Multiple data loaders can be created
## Implementation
- Create a DataLoader factory that has a create data loader method
- The method will accept a string input and if matched, load the requested data
- Create a PlanetDataLoader class, and give it a load method that will load the requested data from the API gateway. With the loaded data as a response invoke the create planet method with the response data provided.
> Modifications to existing implementation
- The interactor will access the repository and add the planet within
- The GetMainPlanet data will need to be renamed to CreateMainPlanet
- A Get controller action will need to exist to get the data from the API. This will have to be lightweight as possible and accesses the repository.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.