本文整理汇总了TypeScript中jQuery.isFunction函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isFunction函数的具体用法?TypeScript isFunction怎么用?TypeScript isFunction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isFunction函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: parse
static parse(rawInput, calendar) {
let rawProps
// normalize raw input
if ($.isFunction(rawInput.events)) { // extended form
rawProps = rawInput
} else if ($.isFunction(rawInput)) { // short form
rawProps = { events: rawInput }
}
if (rawProps) {
return EventSource.parse.call(this, rawProps, calendar)
}
return false
}
示例2: function
pendingf = function () {
var exe = $.Deferred();
var cd = closure();
if (!cd || !$.isFunction(cd.always)) {
throw "Return value of wrapped function must be a deferred";
}
cd = cd.always(function () { exe.resolve(); });
pipeDeferred(cd, d);
return exe;
};
示例3: applyAll
export function applyAll(functions, thisObj, args) {
if ($.isFunction(functions)) {
functions = [ functions ]
}
if (functions) {
let i
let ret
for (i = 0; i < functions.length; i++) {
ret = functions[i].apply(thisObj, args) || ret
}
return ret
}
}
示例4: object
this.each(function(i, _element) { // loop each DOM element involved
let element = $(_element)
let calendar = element.data('fullCalendar') // get the existing calendar object (if any)
let singleRes // the returned value of this single method call
// a method call
if (typeof options === 'string') {
if (options === 'getCalendar') {
if (!i) { // first element only
res = calendar
}
} else if (options === 'destroy') { // don't warn if no calendar object
if (calendar) {
calendar.destroy()
element.removeData('fullCalendar')
}
} else if (!calendar) {
warn('Attempting to call a FullCalendar method on an element with no calendar.')
} else if ($.isFunction(calendar[options])) {
singleRes = calendar[options].apply(calendar, args)
if (!i) {
res = singleRes // record the first method call result
}
if (options === 'destroy') { // for the destroy method, must remove Calendar object data
element.removeData('fullCalendar')
}
} else {
warn("'" + options + "' is an unknown FullCalendar method.")
}
} else if (!calendar) { // don't initialize twice
calendar = new Calendar(element, options)
element.data('fullCalendar', calendar)
calendar.render()
}
})
示例5: isPromise
function isPromise(x: any) {
return x !== undefined && $.isFunction(x.then);
}