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


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

本文整理汇总了TypeScript中falcor-json-graph.pathValue函数的典型用法代码示例。如果您正苦于以下问题:TypeScript pathValue函数的具体用法?TypeScript pathValue怎么用?TypeScript pathValue使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pathValue函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: 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

示例2:

 return Observable.from(keys).map((key: string): FalcorJsonGraph.PathValue => {
   return FalcorJsonGraph.pathValue([this.options.idKey, doc._id, key], doc[key]);
 });
开发者ID:cdhgee,项目名称:investments,代码行数:3,代码来源:GenericModel.ts

示例3:

 return Observable.from(keys).map((key: string): FalcorJsonGraph.PathValue => {
   return FalcorJsonGraph.pathValue([root, doc._id, key], doc[key]);
 });
开发者ID:cdhgee,项目名称:investments,代码行数:3,代码来源:FundModel.ts


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