Skip to content

Commit

Permalink
Refactor atom.dart to make code cleaner (#854)
Browse files Browse the repository at this point in the history
* Update atom.dart

* chore: add a version change

---------

Co-authored-by: Pavan Podila <pavanpodila@users.noreply.github.com>
Co-authored-by: Minsu Lee <amond@amond.net>
  • Loading branch information
3 people committed Feb 3, 2023
1 parent 13b7e6d commit 4400ea1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
3 changes: 2 additions & 1 deletion mobx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## 2.1.2 - 2.1.3
## 2.1.2 - 2.1.3+1

- Fix tests in dart 2.19 - [@amondnet](https://github.com/amondnet)
- Dart formatting fixes
- Refactor `atom.dart` to make code cleaner by [@fzyzcjy](https://github.com/fzyzcjy) in [#854](https://github.com/mobxjs/mobx.dart/pull/854)

## 2.1.1

Expand Down
6 changes: 1 addition & 5 deletions mobx/lib/src/core/atom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@ class Atom {
_addListener(_ListenerKind.onBecomeUnobserved, fn);

void Function() _addListener(_ListenerKind kind, void Function() fn) {
if (_observationListeners[kind] == null) {
_observationListeners[kind] = {}..add(fn);
} else {
_observationListeners[kind]!.add(fn);
}
(_observationListeners[kind] ??= {}).add(fn);

return () {
final listeners = _observationListeners[kind];
Expand Down
2 changes: 1 addition & 1 deletion mobx/lib/version.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated via set_version.dart. !!!DO NOT MODIFY BY HAND!!!

/// The current version as per `pubspec.yaml`.
const version = '2.1.3';
const version = '2.1.3+1';
2 changes: 1 addition & 1 deletion mobx/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: mobx
version: 2.1.3
version: 2.1.3+1
description: "MobX is a library for reactively managing the state of your applications. Use the power of observables, actions, and reactions to supercharge your Dart and Flutter apps."

homepage: https://github.com/mobxjs/mobx.dart
Expand Down

0 comments on commit 4400ea1

Please sign in to comment.