diff --git a/src/models/IConstructor.ts b/src/models/IConstructor.ts index ab81ff8..e4075ce 100644 --- a/src/models/IConstructor.ts +++ b/src/models/IConstructor.ts @@ -1,7 +1,2 @@ // Interface style: -export default interface IConstructor extends Function { - new (...args: any[]): T; -} - -// Union Type style: -export type ConstructorUnion = new (...args: any[]) => T; +export type IConstructor = new (...args: any[]) => T; diff --git a/src/serviceWorker.ts b/src/serviceWorker.ts index cd09347..08f2170 100644 --- a/src/serviceWorker.ts +++ b/src/serviceWorker.ts @@ -18,12 +18,12 @@ const isLocalhost = Boolean( window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/) ); -type Config = { +interface IConfig { onSuccess?: (registration: ServiceWorkerRegistration) => void; onUpdate?: (registration: ServiceWorkerRegistration) => void; -}; +} -export function register(config?: Config) { +export function register(config?: IConfig) { if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { // The URL constructor is available in all browsers that support SW. const publicUrl = new URL((process as { env: { [key: string]: string } }).env.PUBLIC_URL, window.location.href); @@ -44,7 +44,8 @@ export function register(config?: Config) { // Add some additional logging to localhost, pointing developers to the // service worker/PWA documentation. navigator.serviceWorker.ready.then(() => { - console.log('This web app is being served cache-first by a service ' + 'worker. To learn more, visit https://bit.ly/CRA-PWA'); + /* tslint:disable-next-line no-console */ + console.log('This web app is being served cache-first by a service worker. To learn more, visit https://bit.ly/CRA-PWA'); }); } else { // Is not localhost. Just register service worker @@ -54,7 +55,7 @@ export function register(config?: Config) { } } -function registerValidSW(swUrl: string, config?: Config) { +function registerValidSW(swUrl: string, config?: IConfig) { navigator.serviceWorker .register(swUrl) .then((registration) => { @@ -69,6 +70,7 @@ function registerValidSW(swUrl: string, config?: Config) { // At this point, the updated precached content has been fetched, // but the previous service worker will still serve the older // content until all client tabs are closed. + /* tslint:disable-next-line no-console */ console.log('New content is available and will be used when all ' + 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'); // Execute callback @@ -79,6 +81,7 @@ function registerValidSW(swUrl: string, config?: Config) { // At this point, everything has been precached. // It's the perfect time to display a // "Content is cached for offline use." message. + /* tslint:disable-next-line no-console */ console.log('Content is cached for offline use.'); // Execute callback @@ -95,7 +98,7 @@ function registerValidSW(swUrl: string, config?: Config) { }); } -function checkValidServiceWorker(swUrl: string, config?: Config) { +function checkValidServiceWorker(swUrl: string, config?: IConfig) { // Check if the service worker can be found. If it can't reload the page. fetch(swUrl) .then((response) => { @@ -114,6 +117,7 @@ function checkValidServiceWorker(swUrl: string, config?: Config) { } }) .catch(() => { + /* tslint:disable-next-line no-console */ console.log('No internet connection found. App is running in offline mode.'); }); } diff --git a/src/utilities/EffectUtility.ts b/src/utilities/EffectUtility.ts index 360fb83..75927fb 100644 --- a/src/utilities/EffectUtility.ts +++ b/src/utilities/EffectUtility.ts @@ -1,6 +1,6 @@ import HttpUtility from './HttpUtility'; import { AxiosResponse } from 'axios'; -import IConstructor from '../models/IConstructor'; +import { IConstructor } from '../models/IConstructor'; import HttpErrorResponseModel from '../models/HttpErrorResponseModel'; export default class EffectUtility { diff --git a/src/views/components/main-nav/MainNav.tsx b/src/views/components/main-nav/MainNav.tsx index 4924cfc..30ad930 100644 --- a/src/views/components/main-nav/MainNav.tsx +++ b/src/views/components/main-nav/MainNav.tsx @@ -5,13 +5,13 @@ import { NavLink, NavLinkProps } from 'react-router-dom'; interface IProps {} interface IState {} -const Nav = (props: NavLinkProps) => ; +const Nav = (props: NavLinkProps) => ; export default class MainNav extends React.Component { public render(): JSX.Element { return ( - - + + diff --git a/src/views/episodes-page/EpisodesPage.tsx b/src/views/episodes-page/EpisodesPage.tsx index fd799f0..7290565 100644 --- a/src/views/episodes-page/EpisodesPage.tsx +++ b/src/views/episodes-page/EpisodesPage.tsx @@ -45,7 +45,7 @@ class EpisodesPage extends React.Component ( - + {row.episode} {row.date} diff --git a/src/views/home-page/HomePage.tsx b/src/views/home-page/HomePage.tsx index f60a3e9..28734aa 100644 --- a/src/views/home-page/HomePage.tsx +++ b/src/views/home-page/HomePage.tsx @@ -31,7 +31,7 @@ class HomePage extends React.Component - +
Cast