Skip to content

Commit

Permalink
feat: add observable queue
Browse files Browse the repository at this point in the history
  • Loading branch information
amondnet committed Oct 30, 2024
1 parent 6617264 commit 752dc1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mobx/lib/src/api/observable_collections/observable_queue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ class ObservableQueue<T> extends DelegatingQueue<T>
}

@override
bool remove(Object? value) {
bool remove(Object? object) {
var didRemove = false;

_context.conditionallyRunInAction(() {
for (var i = super.length - 1; i >= 0; --i) {
final element = super.elementAt(i);
if (element == value) {
super.remove(value as T);
_notifyRemove(value, i);
if (element == object) {
super.remove(object as T);
_notifyRemove(object, i);
didRemove = true;
}
}
Expand Down

0 comments on commit 752dc1b

Please sign in to comment.