本文整理匯總了TypeScript中@utils/arr.arr_remove函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript arr_remove函數的具體用法?TypeScript arr_remove怎麽用?TypeScript arr_remove使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了arr_remove函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: listeners_off
export function listeners_off(event, fn?) {
if (fn == null) {
bin[event] = [];
return;
}
arr_remove(bin[event], fn);
}
示例2: objMutator_removeObserver
export function objMutator_removeObserver (obj, mutators, cb) {
var obs = obj_getObserversProperty(obj, prop_MUTATORS);
if (obs == null) {
return;
}
if (cb === void 0) {
obs.length = 0;
return;
}
arr_remove(obs, cb);
};
示例3: compo_dispose
export function compo_dispose (compo, parent?) {
if (compo == null)
return false;
if (compo.elements != null) {
dom_removeAll(compo.elements);
compo.elements = null;
}
Component.dispose(compo);
var compos = (parent && parent.components) || (compo.parent && compo.parent.components);
if (compos == null) {
log_error('Parent Components Collection is undefined');
return false;
}
return arr_remove(compos, compo);
};
示例4: obj_removeObserver
export function obj_removeObserver(obj, property, callback?) {
if (obj == null) {
log_error(
'Not possible to remove the observer for "' +
property +
'" as current model is undefined.'
);
return;
}
// nested observer
var parts = property.split('.'),
imax = parts.length,
i = -1,
x = obj;
while (++i < imax) {
x = x[parts[i]];
if (x == null) break;
if (x[prop_OBS] != null) {
obj_removeObserver(x, parts.slice(i + 1).join('.'), callback);
break;
}
}
var obs = obj_getObserversProperty(obj, property);
if (obs != null) {
if (callback === void 0) {
// callback not provided -> remove all observers
obs.length = 0;
} else {
arr_remove(obs, callback);
}
}
var val = obj_getProperty(obj, property),
mutators = getSelfMutators(val);
if (mutators != null) objMutator_removeObserver(val, mutators, callback);
}