/angular-4-SWAPI-graphql-client

RESTful service calls to Star Wars API using RX/JS

Primary LanguageTypeScript

Star Wars API app

Component pattern:

App component contains two children: control and display.

Control

Uses Display Service, Error Service and ErrorNameService.

DisplayService uses a display object as a Subject.

Actor names are read from the config json file into an array.

Array indices map to an image URL array read in from config file.

Images are in an S3 bucket under https to prevent warnings in console.

User click on button triggers getFilms function, which includes calls to Api Service to retrieve and Display Service to show data.

Api Service uses Observables in calls to DataService to retrieve films and film data.

Api Service uses forkJoin to make parallel requests for all film data.

First retrieval of actor data caches object in actorMap to avoid repeat calls to the api gateway

Display

Creates Subscription to Display Service stream