Adds items to the ModelCollection.
The items to add to the ModelCollection.
Removes all items from the ModelCollection.
The name of the event to fire.
Optional arguments to pass to subscribers.
Returns false
if the bus is stopped. Otherwise,
returns a Promise that will resolve with an array of values returned by
event subscribers, or reject with the first Promise rejection or thrown error.
The set of items in the ModelCollection.
NOTE: Returns a shallow copy of the underlying collection. That means the array returned can be mutated without affecting the real ModelCollection, but all the items in the array are the same by reference, so mutating an object in the collection will also mutate the object stored in the ModelCollection.
Adds, updates, and removes items in the underlying collection based on the incoming items.
The items to add or update in the underlying collection. Any items in the existing collection that are not in the incoming collection will be removed.
Registers a subscriber for the given event. The subscriber will be invoked in the context used to create the EventBus and passed any arguments provided to the fire method.
The name of the event to listen for.
The subscriber to invoke when the event is fired.
Method to invoke to remove the subscriber.
Similar to on, except the subscriber will be removed as soon as it is invoked.
The name of the event to listen for.
The subscriber to invoke when the event is fired.
Method to invoke to remove the subscriber.
Removes items from the ModelCollection.
The items to remove from the ModelCollection.
Resumes notifying subscribers after stop was called. Any events fired before resuming are dropped entirely.
Stops notifying subscribers of fired events until resume is called.
Applies a uniqueness constraint to the wrapped ModelCollection items.
Optional iteratee to use as a selector function.
Adds or updates items in the underlying collection. Does not remove any existing items.
The items to add or update in the underlying collection.
Adds methods to update a ModelCollection's items based on a more current collection of items.