本文整理汇总了TypeScript中angular2/src/change_detection/coalesce.coalesce函数的典型用法代码示例。如果您正苦于以下问题:TypeScript coalesce函数的具体用法?TypeScript coalesce怎么用?TypeScript coalesce使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了coalesce函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should replace duplicate terminal records with" + " self records", () => {
var rs = coalesce([r("user", [], 0, 1, true), r("user", [], 0, 2, true)]);
expect(rs[1]).toEqual(new ProtoRecord(RECORD_TYPE_SELF, "self", null, [], null, 1, null, 2,
null, null, true, false));
});
示例2: it
it("should replace duplicate terminal records with self records", () => {
var rs = coalesce(
[r("user", [], 0, 1, {lastInBinding: true}), r("user", [], 0, 2, {lastInBinding: true})]);
expect(rs[1]).toEqual(new ProtoRecord(RecordType.SELF, "self", null, [], null, 1, null, 2,
null, null, true, false, false, false));
});
示例3: coalesce
() => {
var nullFunc = () => {};
var rs = coalesce([
r(nullFunc, [], 0, 1, {directiveIndex: new DirectiveIndex(0, 0)}),
r(nullFunc, [], 0, 1, {directiveIndex: new DirectiveIndex(0, 1)}),
r(nullFunc, [], 0, 1, {directiveIndex: new DirectiveIndex(1, 0)}),
r(nullFunc, [], 0, 1, {directiveIndex: null}),
]);
expect(rs.length).toEqual(4);
});
示例4: coalesce
() => {
var rs = coalesce([
r("user", [], 0, 1),
r("first", [], 1, 2),
r("user", [], 0, 3),
r("last", [], 3, 4)
]);
expect(rs).toEqual([r("user", [], 0, 1), r("first", [], 1, 2), r("last", [], 1, 3)]);
});