reactivedb
Advanced tools
Comparing version 0.10.4-alpha.10-diff to 0.10.4-alpha.11-diff
{ | ||
"name": "reactivedb", | ||
"version": "0.10.4-alpha.10-diff", | ||
"version": "0.10.4-alpha.11-diff", | ||
"description": "Reactive ORM for Lovefield", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -11,2 +11,3 @@ import { Observable } from 'rxjs/Observable' | ||
import { tap } from 'rxjs/operators/tap' | ||
import { filter } from 'rxjs/operators/filter' | ||
import { Selector } from './Selector' | ||
@@ -16,7 +17,6 @@ import { ProxySelector } from './ProxySelector' | ||
import { TokenConsumed } from '../../exception/token' | ||
import { diff, Ops } from '../../utils/diff' | ||
import { diff, Ops, OpsType } from '../../utils/diff' | ||
export interface TraceResult<T> { | ||
export type TraceResult<T> = Ops & { | ||
result: T[] | ||
ops: Ops | ||
} | ||
@@ -77,4 +77,5 @@ | ||
const ops = diff(this.lastEmit, result, pk) | ||
return { result, ops } | ||
return { result, ...ops } | ||
}), | ||
filter((xs) => xs.type !== OpsType.ShouldSkip), | ||
tap(({ result }) => (this.lastEmit = result)), | ||
@@ -81,0 +82,0 @@ ) |
@@ -14,3 +14,3 @@ export enum OpType { | ||
Success, | ||
SuccessAndSkip, | ||
ShouldSkip, | ||
} | ||
@@ -45,3 +45,3 @@ | ||
return newList | ||
case OpsType.SuccessAndSkip: | ||
case OpsType.ShouldSkip: | ||
return oldList | ||
@@ -176,5 +176,5 @@ case OpsType.Success: | ||
return { | ||
type: arrayIsSame ? OpsType.SuccessAndSkip : OpsType.Success, | ||
type: arrayIsSame ? OpsType.ShouldSkip : OpsType.Success, | ||
ops: ret, | ||
} | ||
} |
@@ -1,1 +0,1 @@ | ||
export default '0.10.4-alpha.9-diff' | ||
export default '0.10.4-alpha.10-diff-alpha0.10.4-alpha.10-diff-diff' |
@@ -6,6 +6,5 @@ import { Observable } from 'rxjs/Observable'; | ||
import { Ops } from '../../utils/diff'; | ||
export interface TraceResult<T> { | ||
export declare type TraceResult<T> = Ops & { | ||
result: T[]; | ||
ops: Ops; | ||
} | ||
}; | ||
export declare type SelectorMeta<T> = Selector<T> | ProxySelector<T>; | ||
@@ -12,0 +11,0 @@ export declare class QueryToken<T> { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var Observable_1 = require("rxjs/Observable"); | ||
@@ -12,2 +13,3 @@ var combineAll_1 = require("rxjs/operators/combineAll"); | ||
var tap_1 = require("rxjs/operators/tap"); | ||
var filter_1 = require("rxjs/operators/filter"); | ||
var ProxySelector_1 = require("./ProxySelector"); | ||
@@ -46,4 +48,4 @@ var assert_1 = require("../../utils/assert"); | ||
var ops = diff_1.diff(_this.lastEmit, result, pk); | ||
return { result: result, ops: ops }; | ||
}), tap_1.tap(function (_a) { | ||
return tslib_1.__assign({ result: result }, ops); | ||
}), filter_1.filter(function (xs) { return xs.type !== diff_1.OpsType.ShouldSkip; }), tap_1.tap(function (_a) { | ||
var result = _a.result; | ||
@@ -50,0 +52,0 @@ return (_this.lastEmit = result); |
@@ -12,3 +12,3 @@ export declare enum OpType { | ||
Success = 1, | ||
SuccessAndSkip = 2, | ||
ShouldSkip = 2, | ||
} | ||
@@ -15,0 +15,0 @@ export declare type Ops = { |
@@ -12,3 +12,3 @@ "use strict"; | ||
OpsType[OpsType["Success"] = 1] = "Success"; | ||
OpsType[OpsType["SuccessAndSkip"] = 2] = "SuccessAndSkip"; | ||
OpsType[OpsType["ShouldSkip"] = 2] = "ShouldSkip"; | ||
})(OpsType = exports.OpsType || (exports.OpsType = {})); | ||
@@ -32,3 +32,3 @@ // as an example, use diff to patch data | ||
return newList; | ||
case OpsType.SuccessAndSkip: | ||
case OpsType.ShouldSkip: | ||
return oldList; | ||
@@ -140,3 +140,3 @@ case OpsType.Success: | ||
return { | ||
type: arrayIsSame ? OpsType.SuccessAndSkip : OpsType.Success, | ||
type: arrayIsSame ? OpsType.ShouldSkip : OpsType.Success, | ||
ops: ret, | ||
@@ -143,0 +143,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
declare const _default: "0.10.4-alpha.9-diff"; | ||
declare const _default: "0.10.4-alpha.10-diff-alpha0.10.4-alpha.10-diff-diff"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = '0.10.4-alpha.9-diff'; | ||
exports.default = '0.10.4-alpha.10-diff-alpha0.10.4-alpha.10-diff-diff'; | ||
//# sourceMappingURL=version.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
294937
5281