當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript pipeline.default函數代碼示例

本文整理匯總了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)
     }
   ])
 }
開發者ID:durandal79,項目名稱:vineyard-test-suite,代碼行數:9,代碼來源:solr-test.ts

示例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.')
      }
    ])
  },
開發者ID:durandal79,項目名稱:vineyard-test-suite,代碼行數:55,代碼來源:update-test.ts

示例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)
      }
    ])
  }
開發者ID:durandal79,項目名稱:vineyard-test-suite,代碼行數:21,代碼來源:login-test.ts


注:本文中的when/pipeline.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。