Compare commits

..

2 Commits

Author SHA1 Message Date
811e2490b8 5.0.3 2022-05-19 16:15:28 +02:00
206ccd40e9 fix(watcher.changeSubject): now emits correct type into observer functions 2022-05-19 16:15:28 +02:00
4 changed files with 6 additions and 6 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@pushrocks/smartdata", "name": "@pushrocks/smartdata",
"version": "5.0.2", "version": "5.0.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@pushrocks/smartdata", "name": "@pushrocks/smartdata",
"version": "5.0.2", "version": "5.0.3",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@pushrocks/lik": "^5.0.4", "@pushrocks/lik": "^5.0.4",

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartdata", "name": "@pushrocks/smartdata",
"version": "5.0.2", "version": "5.0.3",
"private": false, "private": false,
"description": "do more with data", "description": "do more with data",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartdata', name: '@pushrocks/smartdata',
version: '5.0.2', version: '5.0.3',
description: 'do more with data' description: 'do more with data'
} }

View File

@ -11,11 +11,11 @@ export class SmartdataDbWatcher<T = any> {
// INSTANCE // INSTANCE
private changeStream: plugins.mongodb.ChangeStream<T>; private changeStream: plugins.mongodb.ChangeStream<T>;
public changeSubject = new plugins.smartrx.rxjs.Subject<SmartDataDbDoc<T, T>>(); public changeSubject = new plugins.smartrx.rxjs.Subject<T>();
constructor(changeStreamArg: plugins.mongodb.ChangeStream<T>, smartdataDbDocArg: typeof SmartDataDbDoc) { constructor(changeStreamArg: plugins.mongodb.ChangeStream<T>, smartdataDbDocArg: typeof SmartDataDbDoc) {
this.changeStream = changeStreamArg; this.changeStream = changeStreamArg;
this.changeStream.on('change', async (item: T) => { this.changeStream.on('change', async (item: T) => {
this.changeSubject.next(smartdataDbDocArg.createInstanceFromMongoDbNativeDoc(item)); this.changeSubject.next(smartdataDbDocArg.createInstanceFromMongoDbNativeDoc(item) as any as T);
}) })
plugins.smartdelay.delayFor(0).then(() => { plugins.smartdelay.delayFor(0).then(() => {
this.readyDeferred.resolve(); this.readyDeferred.resolve();