Docs (4.0.0)
class ManagedList method

attachAll

Enable (or disable) attaching of new objects to the list itself.

attachAll(set: boolean, noEventPropagation?: boolean): this

Summary

This method can be used to make the list contain all of its (current and new) objects by attaching them. After enabling auto-attachment, adding an object to the list automatically attaches it; removing an object from the list automatically unlinks it (since it’s no longer attached); attaching an object to another object (or list) automatically removes it from the list (since it can no longer be attached) — but the object won’t be unlinked.

When enabled, if the list currently contains any objects, they’re immediately attached. Note that the feature can’t be disabled once it has been enabled and there are any objects in the list.

When enabled, events emitted on any object in the list are automatically re-emitted on the list itself (propagating the event) — unless the noEventPropagation argument is set to true.

Note
Objects in a list that’s itself attached to another object are also automatically attached. On a list that’s itself attached, you may use this method to disable this feature before adding any objects.

Parameters

  • set — True if all new objects should be attached to the list
  • noEventPropagation — True if events should not be re-emitted on the list itself

Errors

  • This method throws an error if the feature can’t be enabled or disabled.

Related