Options
All
  • Public
  • Public/Protected
  • All
Menu

The main class

example
const streams = new Streams({
baseURL: 'http://localhost/api',
});


async function run(){
const stream = await streams.make('clients')
const clients = await stream.entries()
.where('age', '>', 5)
.where('age', '<', 50)
.orderBy('age', 'asc')
.get();
for(const client of clients){
client.email;
client.age;
}
}

Hierarchy

  • Streams

Index

Constructors

constructor

Properties

Private #http

#http: Http

config

Readonly hooks

hooks: { all: AsyncSeriesWaterfallHook<[IBaseStream<any>], UnsetAdditionalOptions>; createRequest: SyncWaterfallHook<[Request<any, any>], UnsetAdditionalOptions>; createRequestConfig: SyncWaterfallHook<[RequestConfig<any>], UnsetAdditionalOptions>; created: SyncHook<[Stream<string | number>], void, UnsetAdditionalOptions>; maked: SyncHook<[Stream<string | number>], void, UnsetAdditionalOptions> } = ...

Type declaration

  • all: AsyncSeriesWaterfallHook<[IBaseStream<any>], UnsetAdditionalOptions>
  • createRequest: SyncWaterfallHook<[Request<any, any>], UnsetAdditionalOptions>
  • createRequestConfig: SyncWaterfallHook<[RequestConfig<any>], UnsetAdditionalOptions>
  • created: SyncHook<[Stream<string | number>], void, UnsetAdditionalOptions>
  • maked: SyncHook<[Stream<string | number>], void, UnsetAdditionalOptions>

Static defaults

defaults: Partial<StreamsConfiguration> = ...

Accessors

http

Methods

all

  • all(): Promise<Stream<string | number>[]>

collection

create

createRequest

  • createRequest<T, D>(): Request<T, D>

entries

  • entries<ID>(id: ID): Promise<Criteria<ID>>

make

  • make<ID>(id: ID): Promise<Stream<ID>>

Protected registerEtag

  • registerEtag(): void

repository