本文整理汇总了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;未经允许,请勿转载。 |
请发表评论