本文整理汇总了TypeScript中when/pipeline.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: pipeline
"suggestions": function() {
return pipeline([
()=> lab.get_json('/vineyard/solr/character/suggest?q=jam'),
(response)=> {
console.log('response', response.objects)
assert.equals(response.objects.length, 1)
}
])
}
示例2: pipeline
"counts": function () {
var query = {
"trellis": "character",
"filters": [
{
"path": "name",
"value": "James"
}
]
}
var update1 = {
"objects": [
{
"trellis": "item",
"id": 25,
"owner": 1,
"name": "syringe"
}
]
}
var update2 = {
"objects": [
{
"trellis": "item",
"id": 25,
"_deleted_": true
}
]
}
return pipeline([
()=> Irrigation.query(query, fixture.users['cj'], ground, lab.vineyard),
(response) => {
var objects = response.objects
console.log('response', response)
assert.equals(objects[0].item_count, 2)
},
()=> Irrigation.update(update1, fixture.users['cj'], ground, lab.vineyard),
()=> Irrigation.query(query, fixture.users['cj'], ground, lab.vineyard),
(response) => {
var objects = response.objects
console.log('response', response)
assert.equals(objects[0].item_count, 3)
},
()=> Irrigation.update(update2, fixture.users['cj'], ground, lab.vineyard),
()=> Irrigation.query(query, fixture.users['cj'], ground, lab.vineyard),
(response) => {
var objects = response.objects
console.log('response', response)
assert.equals(objects[0].item_count, 2, 'Deleting item updated item count.')
}
])
},
示例3: pipeline
"photo notifications": function () {
var socket
var update = {
objects: [
{
"trellis": "character",
"name": "deleteme"
}
]
}
return pipeline([
()=> lab.login_socket('cj', 'pass'),
(s) => socket = s,
()=> lab.emit(socket, 'room/join', 'event/7E6FB110-9B43-11E3-895F-CB7A0150F761'),
()=> {
assert(true)
return lab.emit(socket, 'update', update)
}
])
}