This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* You can add global styles to this file, and also import other style files */ | |
| /* Bootstrap */ | |
| @import '~bootstrap/dist/css/bootstrap.css'; | |
| @import './styles/position-helpers'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class DateErrorStateMatcher implements ErrorStateMatcher { | |
| private hasError: boolean = undefined; | |
| constructor(hasError$: Observable<boolean>, destroy$: Observable<void>) { | |
| hasError$.pipe(takeUntil(destroy$)).subscribe(hasError => { | |
| this.hasError = hasError; | |
| }); | |
| } | |
| public isErrorState( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { fakeAsync, tick } from '@angular/core/testing'; | |
| import { of, throwError } from 'rxjs'; | |
| import { mergeMap } from 'rxjs/operators'; | |
| import { | |
| exponentialBackoffRetry, | |
| RETRY_COUNT, | |
| RETRY_TIME, | |
| } from './exponential-backoff-retry'; | |
| describe('exponentialBackoffRetry', () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Observable, pipe, range, throwError, zip, of, timer } from 'rxjs'; | |
| import { map, mergeMap, retryWhen } from 'rxjs/operators'; | |
| export const RETRY_COUNT = 3; | |
| export const RETRY_TIME = 500; | |
| export function exponentialBackoffRetry<T>( | |
| maxTries: number = RETRY_COUNT, | |
| delay: number = RETRY_TIME, | |
| ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ApolloCache } from '@apollo/client/core'; | |
| import { DocumentNode } from 'graphql'; | |
| export interface EntityObject { | |
| id: string; | |
| } | |
| export function createInCache<ReadQueryResponseT>( | |
| toCreate: EntityObject, | |
| readQuery: DocumentNode, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('TodoListEffects', () => { | |
| let actions: Observable<any>; | |
| let effects: TodoListEffects; | |
| beforeEach(() => { | |
| TestBed.configureTestingModule({ | |
| providers: [ | |
| TodoListEffects, | |
| provideMockActions(() => actions), | |
| mockProvider(TodoListResourcesService), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function containsInNestedObjectBF(obj, val) { | |
| const queue = [obj]; | |
| while (queue.length > 0) { | |
| const currentObj = queue.shift(); | |
| if (currentObj === val) { | |
| return true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ApolloServer, AuthenticationError } from 'apollo-server-express'; | |
| import responseCachePlugin from 'apollo-server-plugin-response-cache'; | |
| import * as express from 'express'; | |
| import admin from 'firebase-admin'; | |
| import { AuthIdentity, RequestContext } from './auth-identity'; | |
| import { resolvers } from './resolvers'; | |
| import { typeDefs } from './schema'; | |
| /* Async verification with user token */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ApolloServer, AuthenticationError } from 'apollo-server-express'; | |
| import responseCachePlugin from 'apollo-server-plugin-response-cache'; | |
| import * as express from 'express'; | |
| import admin from 'firebase-admin'; | |
| import { AuthIdentity, RequestContext } from './auth-identity'; | |
| import { resolvers } from './resolvers'; | |
| import { typeDefs } from './schema'; | |
| /* Async verification with user token */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { region } from 'firebase-functions'; | |
| import { gqlServer } from './app/server'; | |
| import { environment } from './environments/environment'; | |
| const dotenvJSON = require('dotenv-json'); | |
| if (environment.production) { | |
| dotenvJSON({ path: __dirname + '/assets/env.json' }); | |
| } else { | |
| dotenvJSON({ path: __dirname + '/assets/env.local.json' }); | |
| } |
NewerOlder