blow-collection
v0.1.16
Published
Simple in memory collection with Rx / Observable interface.
Downloads
9
Maintainers
Readme
blow-collection
Simple in memory collection with Rx / Observable interface.
interface CollectionOptions {
idKey?: string;
idGenerator?: () => string | number;
}
class Collection<T> {
constructor(options?: CollectionOptions);
create(data: any): Observable<T>;
update(where: QueryWhere, data: any): Observable<number>;
updateOrCreate(data: any): Observable<T>;
count(where: QueryWhere): Observable<number>;
destroy(where: QueryWhere): Observable<number>;
destroyById(id: any): Observable<boolean>;
find(query?: QueryObject): Observable<T>;
findOne(query: QueryObject): Observable<T>;
findById(id: any): Observable<T>;
findOrCreate(where: QueryWhere, data: any): Observable<T>;
exists(id: any): Observable<boolean>;
}