fix(core): update
This commit is contained in:
@ -42,14 +42,14 @@ class House extends smartdata.SmartDataDbDoc<House, House> {
|
||||
@smartdata.svDb()
|
||||
public data = {
|
||||
id: smartunique.shortId(),
|
||||
hello: 'hello'
|
||||
}
|
||||
hello: 'hello',
|
||||
};
|
||||
}
|
||||
|
||||
tap.test('should watch a collection', async (toolsArg) => {
|
||||
const done = toolsArg.defer();
|
||||
const watcher = await House.watch({});
|
||||
watcher.changeSubject.subscribe(async houseArg => {
|
||||
watcher.changeSubject.subscribe(async (houseArg) => {
|
||||
console.log('hey there, we observed a house');
|
||||
await watcher.close();
|
||||
done.resolve();
|
||||
@ -58,7 +58,7 @@ tap.test('should watch a collection', async (toolsArg) => {
|
||||
await newHouse.save();
|
||||
console.log('saved a house');
|
||||
await done.promise;
|
||||
})
|
||||
});
|
||||
|
||||
// =======================================
|
||||
// close the database connection
|
||||
@ -71,4 +71,4 @@ tap.test('close', async () => {
|
||||
}
|
||||
});
|
||||
|
||||
tap.start({ throwOnError: true });
|
||||
tap.start({ throwOnError: true });
|
||||
|
Reference in New Issue
Block a user