本文整理汇总了TypeScript中rsvp.hash函数的典型用法代码示例。如果您正苦于以下问题:TypeScript hash函数的具体用法?TypeScript hash怎么用?TypeScript hash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hash函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: hash
.then((result) => {
return hash({
limitedArticleEntries: result.allArticleEntries.slice(0, 2),
limitedJournalEntries: result.allJournalEntries.slice(0, 2),
limitedBitEntries: result.allBitEntries.slice(0, 2)
})
})
开发者ID:jeffjewiss,项目名称:jeffjewiss,代码行数:7,代码来源:index.ts
示例2: model
model () {
let shoebox = this.fastboot.shoebox
let shoeboxStore = shoebox.retrieve('now')
let text = this.markdownResolver.file('text', 'now')
let currentlyListening
if (this.fastboot.isFastBoot) {
currentlyListening = this.apollo
.query({ query })
.then((result) => {
if (!shoeboxStore) {
shoeboxStore = {}
shoebox.put('now', shoeboxStore)
}
shoeboxStore.currentlyListening = result.currentlyListening
return result.currentlyListening
})
.catch(console.error)
} else {
currentlyListening = shoeboxStore ? shoeboxStore.currentlyListening : null
if (!currentlyListening) {
currentlyListening = this.apollo
.query({ query })
.then((result) => result.currentlyListening)
}
}
return hash({
text,
currentlyListening
})
}
开发者ID:jeffjewiss,项目名称:jeffjewiss,代码行数:33,代码来源:now.ts
示例3: model
model(params, transition) {
const store = this.get('store');
const id = params.housingRequestId;
const housingRequest = store.findRecord('housing-request', id, {
include: 'registration,housing_provision'
});
return RSVP.hash({ housingRequest });
}
开发者ID:NullVoxPopuli,项目名称:aeonvera-ui,代码行数:10,代码来源:route.ts
示例4: testHash
function testHash() {
let promises = {
myPromise: RSVP.resolve(1),
yourPromise: RSVP.resolve('2'),
theirPromise: RSVP.resolve({ key: 3 }),
notAPromise: 4,
};
RSVP.hash(promises, 'my label').then(function(hash) {
assertType<number>(hash.myPromise);
assertType<string>(hash.yourPromise);
assertType<{ key: number }>(hash.theirPromise);
assertType<number>(hash.notAPromise);
});
}
开发者ID:Dru89,项目名称:DefinitelyTyped,代码行数:14,代码来源:rsvp-tests.ts
示例5: model
model () {
return hash({
text: this.markdownResolver.file('text', 'bookshelf')
})
}
开发者ID:jeffjewiss,项目名称:jeffjewiss,代码行数:5,代码来源:bookshelf.ts
示例6: return
let filterFn = (item: number) => {
return item > 1;
};
RSVP.filter(promiseArray, filterFn).then(result => {});
RSVP.hashSettled(promiseHash).then(hash => {
return (
hash.promiseA.state === 'fulfilled' &&
hash.promiseB.value === 2 &&
hash.promiseC.reason === '3' &&
hash.notAPromise.state === 'fulfilled'
);
});
RSVP.hash(promiseHash).then(
values => {
return (
values.promiseA < 0 &&
values.promiseB === 4 &&
values.promiseC === 12 &&
values.notAPromise > 0
);
},
err => {}
);
let mapFn = function(item: number) {
return item + 1;
};
RSVP.map(promiseArray, mapFn).then(function(result) {});
开发者ID:DxCx,项目名称:DefinitelyTyped,代码行数:30,代码来源:rsvp-tests.ts
示例7: model
model () {
return hash({
bio: this.markdownResolver.file('text', 'about/bio'),
blurb: this.markdownResolver.file('text', 'about/blurb')
})
}
开发者ID:jeffjewiss,项目名称:jeffjewiss,代码行数:6,代码来源:about.ts
注:本文中的rsvp.hash函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论