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


TypeScript Fun.constant方法代碼示例

本文整理匯總了TypeScript中@ephox/katamari.Fun.constant方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Fun.constant方法的具體用法?TypeScript Fun.constant怎麽用?TypeScript Fun.constant使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@ephox/katamari.Fun的用法示例。


在下文中一共展示了Fun.constant方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: load

 return Future.nu(function (resolve) {
   load(
     url,
     Fun.compose(resolve, Fun.constant(Result.value(url))),
     Fun.compose(resolve, Fun.constant(Result.error(url)))
   );
 });
開發者ID:tinymce,項目名稱:tinymce,代碼行數:7,代碼來源:StyleSheetLoader.ts

示例2: function

 const actionName = function (action) {
   return action.fold(
     Fun.constant('remove'),
     Fun.constant('moveToElement'),
     Fun.constant('moveToPosition')
   );
 };
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:7,代碼來源:CefDeleteActionTest.ts

示例3: function

    const wrapEvent = function (event) {
      // IE9 minimum
      const target = Element.fromDom(event.target);

      const stop = function () {
        event.stopPropagation();
      };

      const prevent = function () {
        event.preventDefault();
      };

      const kill = Fun.compose(prevent, stop); // more of a sequence than a compose, but same effect

      // FIX: Don't just expose the raw event. Need to identify what needs standardisation.
      return {
        target:  Fun.constant(target),
        x:       Fun.constant(event.x),
        y:       Fun.constant(event.y),
        stop,
        prevent,
        kill,
        raw:     Fun.constant(event)
      };
    };
開發者ID:abstask,項目名稱:tinymce,代碼行數:25,代碼來源:CellSelection.ts

示例4: function

const selection = function (cell, selections) {
  return SelectionTypes.cata(selections.get(),
    Fun.constant([]),
    Fun.identity,
    Fun.constant([ cell ])
  );
};
開發者ID:abstask,項目名稱:tinymce,代碼行數:7,代碼來源:CellOperations.ts

示例5: function

 const locationName = function (location) {
   return location.fold(
     Fun.constant('before'),
     Fun.constant('start'),
     Fun.constant('end'),
     Fun.constant('after')
   );
 };
開發者ID:abstask,項目名稱:tinymce,代碼行數:8,代碼來源:BoundaryLocationTest.ts

示例6: function

const getName = function (location) {
  return location.fold(
    Fun.constant('before'), // Before
    Fun.constant('start'),  // Start
    Fun.constant('end'),    // End
    Fun.constant('after')   // After
  );
};
開發者ID:aha-app,項目名稱:tinymce-word-paste-filter,代碼行數:8,代碼來源:BoundaryLocation.ts

示例7: function

const isInsideAnchor = function (location) {
  return location.fold(
    Fun.constant(false),
    isAnchorLink,
    isAnchorLink,
    Fun.constant(false)
  );
};
開發者ID:howardjing,項目名稱:tinymce,代碼行數:8,代碼來源:InsertBr.ts

示例8: function

const isAtStartOrEnd = function (location) {
  return location.fold(
    Fun.constant(false), // Before
    Fun.constant(true),  // Start
    Fun.constant(true),  // End
    Fun.constant(false)  // After
  );
};
開發者ID:abstask,項目名稱:tinymce,代碼行數:8,代碼來源:InsertSpace.ts

示例9:

 return Option.from(rects[0]).bind(function (rect) {
   const viewTop = rect.top() - socket.dom().scrollTop;
   const outside = viewTop > outerWindow.innerHeight + VIEW_MARGIN || viewTop < -VIEW_MARGIN;
   return outside ? Option.some({
     top: Fun.constant(viewTop),
     bottom: Fun.constant(viewTop + rect.height())
   }) : Option.none();
 });
開發者ID:abstask,項目名稱:tinymce,代碼行數:8,代碼來源:IosSetup.ts

示例10: function

const forMenu = function (selections, table, cell) {
  return {
    element: Fun.constant(cell),
    mergable: Fun.constant(CellOperations.mergable(table, selections)),
    unmergable: Fun.constant(CellOperations.unmergable(cell, selections)),
    selection: Fun.constant(CellOperations.selection(cell, selections))
  };
};
開發者ID:danielpunkass,項目名稱:tinymce,代碼行數:8,代碼來源:TableTargets.ts


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