Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GlobalRegistry

A convenient class to manage global variables.

Hierarchy

Index

Constructors

constructor

Accessors

length

  • get length(): number

Methods

[Symbol.iterator]

all

associate

asyncPipe

at

average

clone

collapse

concat

contains

count

  • count(): number

diff

diffUsing

each

every

everyWhere

filter

find

first

firstWhere

firstWhereNot

forPage

get

getGlobal

  • getGlobal(key: string | symbol): any
  • Retrieve the value of the given key, if it exists in the store.

    Parameters

    • key: string | symbol

    Returns any

groupBy

  • Return an object mapping key values to arrays of records with that key.

    example
    const users = collect([
     {uid: 1, name: 'John', type: 'admin'},
     {uid: 2, name: 'Jane', type: 'user'},
     {uid: 3, name: 'James', type: 'user'},
    ])
    
    users.groupBy('type')  // => {admin: [{uid: 1, ...}], user: [{uid: 2, ...}, {uid: 3, ...}]}
    

    Type parameters

    • T2

    Parameters

    Returns any

implode

  • implode(delimiter: string): string

includes

intersect

isEmpty

  • isEmpty(): boolean

isNotEmpty

  • isNotEmpty(): boolean

join

  • join(delimiter: string): string

keyBy

keyMap

last

lastWhere

lastWhereNot

map

max

median

merge

min

mode

nth

pad

partialMap

pipe

pluck

  • Map the collection to a collection of the values of the key.

    example
    const users = collect([
     {uid: 1, name: 'John', type: 'admin'},
     {uid: 2, name: 'Jane', type: 'user'},
     {uid: 3, name: 'James', type: 'user'},
    ])
    
    users.pluck('name')  // => Collection['John', 'Jane', 'James']
    

    Type parameters

    • T2

    Parameters

    Returns Collection<T2>

pop

prepend

promiseMap

  • Like map(), but the callback can be async.

    example

    A trivial example, but demonstrative:

    const collection = collect([1, 2, 3])
    
    collection.map(async item => item + 1)  // => Collection[Promise<1>, Promise<2>, Promise<3>]
    
    collection.promiseMap(async item => item + 1)  // => Promise<Collection[2, 3, 4]>
    

    Type parameters

    • T2

    Parameters

    Returns Promise<Collection<T2>>

push

put

random

reduce

reject

reverse

search

setGlobal

shift

shuffle

slice

some

sort

sortBy

sortByDesc

sortDesc

splice

sum

take

tap

toArray

  • toArray(): any[]

toJSON

  • toJSON(replacer?: undefined, space?: number): string

unique

unless

when

where

whereIn

whereMax

whereMin

whereNot

whereNotIn

Static collect

Static fill

  • fill<T2>(size: number, item: T2): Collection<T2>

Static normalize

  • normalize<T2>(itemOrItems: undefined | T2 | (undefined | T2)[]): Collection<T2>

Static size

Extollo Logo

extollo (v. latin) - to lift up, to elevate

Extollo is a free & libre application framework in TypeScript.