UNPKG

@nestjs/graphql

Version:

GraphQL for NestJS: code-first and schema-first APIs, resolvers as providers, subscriptions, federation and generated SDL, on Apollo or Mercurius.

24 lines (23 loc) • 639 B
export class ArrayWithGlobalCacheCollection { constructor(globalArray) { this.globalArray = globalArray; this.internalArray = []; } getAll() { return this.internalArray; } push(...items) { this.globalArray.push(...items); return this.internalArray.push(...items); } unshift(...items) { this.globalArray.unshift(...items); return this.internalArray.unshift(...items); } reverse() { return this.internalArray.reverse(); } reduce(callbackfn, initialValue) { return this.internalArray.reduce(callbackfn, initialValue); } }