本文整理匯總了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)
}
])
}