本文整理匯總了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);
}