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