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 ApolloClient, { ApolloClientOptions, ApolloQueryResult, MutationOptions, MutationUpdaterFn, ObservableQuery, OperationVariables, WatchQueryOptions } from 'apollo-client'; | |
import { DocumentNode } from 'graphql'; | |
import { FetchResult } from 'apollo-link'; | |
import { DataProxy } from 'apollo-cache'; | |
import { QueryRef } from 'apollo-angular'; | |
import { R } from 'apollo-angular/types'; | |
interface IMutationUpdateEvent<T = any> { | |
mutation: DocumentNode; | |
dataProxy: DataProxy; |
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
export interface IClassConstructor<T> { | |
new (...args: any[]): T; | |
} | |
/** generic TypeScript Type Guard | |
* https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards | |
*/ | |
export function isDuckTypeEquivalentToClass<T>(objectToTest: any, classToTest: IClassConstructor<T>): objectToTest is T { | |
if (objectToTest instanceof classToTest) { | |
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 { Injectable } from '@angular/core'; | |
import { Observable, Subject } from 'rxjs/Rx'; | |
import { filter, map } from 'rxjs/operators'; | |
export interface IClassConstructor<T> { | |
new (...args: any[]): T; | |
} | |
export interface IMessage { | |
channel: Function; |
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
/** | |
* @description Configures an CreateOverrideableArray generator function returning arrays with provided array methods overriden or added | |
* @param {{ 'functionName': { 'functionToApply': () => any, 'overrideNativeMethod'?: boolean } }} configuration - configuration object | |
* @returns {function: any[]} CreateOverriddenArray - returns an array of provided parameters with array methods configured | |
*/ | |
export function ConfigureOverridableArrayFactory(configuration: {}) { | |
const callingContext = this; | |
const protoIsSupported = { __proto__: [] } instanceof Array; // Test browser for __proto__ property support | |
// save all standard array methods in a list | |
const anArray: any[] = new Array(); |