本文整理汇总了TypeScript中falcor-json-graph.pathInvalidation函数的典型用法代码示例。如果您正苦于以下问题:TypeScript pathInvalidation函数的具体用法?TypeScript pathInvalidation怎么用?TypeScript pathInvalidation使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pathInvalidation函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: add
public add(doc: any): Observable<FalcorJsonGraph.PathValue | FalcorJsonGraph.InvalidPath> {
let obj: any = {
_id: doc._id
};
this.options.fields.forEach((f: string): void => {
obj[f] = doc[f];
});
return Observable.concat(
this.put(obj),
Observable.from([FalcorJsonGraph.pathInvalidation([this.options.indexKey])])
);
}
示例2: ref
const keySet02: KeySet = [stringKey];
const KeySet03: KeySet = {from: 1, to: 10};
const KeySet04: KeySet = ["name", {from: 0, length: 10}];
const path0: Path = ["productsById", "1234", "name"];
const path1: Path = [stringKey, numberKey, booleanKey];
const pathSet01: PathSet = ["productsById", ["1234", "5678"], ["name", "price"]];
const pathSet02: PathSet = ["products", [{from: 0, length: 10}, "length"], ["name", "price"]];
var ref01 = ref(['hoge']);
var ref02 = ref(['hoge'], {$expires: 1000});
console.log(ref02.$type, ref02.value, ref02.$expires);
var atom01 = atom('hoge');
var atom02 = atom('hoge', {$expires: 1000});
console.log(atom02.$type, atom02.value, atom02.$expires);
var err01 = error('some error!');
var err02 = error('some error!', {$expires: 1000});
console.log(err02.$type === 'error', ref02.value, ref02.$expires);
var pv01 = pathValue('hoge', 'FOO');
var pv02 = pathValue('hoge[0].bar', 'FOO');
var pv03 = pathValue('hoge[0...100].bar', 'FOO');
var pv04 = pathValue(['hoge', {from: 0, to: 100}, 'bar'], 'FOO');
console.log(pv04.path, pv04.value);
var ip01 = pathInvalidation('hoge');
console.log(ip01.path, ip01.invalidate);
示例3:
return this.put(obj).flatMap((response: any): Array<FalcorJsonGraph.InvalidPath> => {
return [
FalcorJsonGraph.pathInvalidation([this.options.idKey, doc._id]),
FalcorJsonGraph.pathInvalidation([this.options.indexKey])
];
});