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


TypeScript types.isFunction函數代碼示例

本文整理匯總了TypeScript中core/util/types.isFunction函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript isFunction函數的具體用法?TypeScript isFunction怎麽用?TypeScript isFunction使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: _emit_callback

 protected _emit_callback(): void {
   if (this.callback != null) {
     if (isFunction(this.callback))
       this.callback(this)
     else
       this.callback.execute(this, {})
   }
 }
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:8,代碼來源:range.ts

示例2: callback

 this.connect(this.properties.selected.change, () => {
   const {callback} = this
   if (callback != null) {
     if (isFunction(callback))
       callback(this)
     else
       callback.execute(this)
   }
 })
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:9,代碼來源:data_source.ts

示例3: function

const _strftime = function(t, format) {
  if (isFunction(format)) {
    return format(t);
  } else {
    // Python's datetime library augments the microsecond directive %f, which is not
    // supported by the javascript library timezone: http://bigeasy.github.io/timezone/.
    // Use a regular expression to replace %f directive with microseconds.
    // TODO: what should we do for negative microsecond strings?
    const microsecond_replacement_string = sprintf("$1%06d", _us(t));
    format = format.replace(/((^|[^%])(%%)*)%f/, microsecond_replacement_string);

    if (format.indexOf("%") === -1) {
      // timezone seems to ignore any strings without any formatting directives,
      // and just return the time argument back instead of the string argument.
      // But we want the string argument, in case a user supplies a format string
      // which doesn't contain a formatting directive or is only using %f.
      return format;
    }
    return tz(t, format);
  }
};
開發者ID:FourtekIT-incubator,項目名稱:bokeh,代碼行數:21,代碼來源:datetime_tick_formatter.ts


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