当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript falcor-json-graph.pathInvalidation函数代码示例

本文整理汇总了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])])
   );
 }
开发者ID:cdhgee,项目名称:investments,代码行数:12,代码来源:GenericModel.ts

示例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);
开发者ID:0815fox,项目名称:DefinitelyTyped,代码行数:30,代码来源:falcor-json-graph-tests.ts

示例3:

 return this.put(obj).flatMap((response: any): Array<FalcorJsonGraph.InvalidPath> => {
   return [
     FalcorJsonGraph.pathInvalidation([this.options.idKey, doc._id]),
     FalcorJsonGraph.pathInvalidation([this.options.indexKey])
   ];
 });
开发者ID:cdhgee,项目名称:investments,代码行数:6,代码来源:GenericModel.ts


注:本文中的falcor-json-graph.pathInvalidation函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。