diff --git a/mobx/CHANGELOG.md b/mobx/CHANGELOG.md index 5ed353fba..78be08618 100644 --- a/mobx/CHANGELOG.md +++ b/mobx/CHANGELOG.md @@ -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 diff --git a/mobx/lib/src/core/atom.dart b/mobx/lib/src/core/atom.dart index f9b579772..56005c7d3 100644 --- a/mobx/lib/src/core/atom.dart +++ b/mobx/lib/src/core/atom.dart @@ -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]; diff --git a/mobx/lib/version.dart b/mobx/lib/version.dart index 34cc06f1b..dde8ee573 100644 --- a/mobx/lib/version.dart +++ b/mobx/lib/version.dart @@ -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'; diff --git a/mobx/pubspec.yaml b/mobx/pubspec.yaml index fb1ad30cf..e81d01082 100644 --- a/mobx/pubspec.yaml +++ b/mobx/pubspec.yaml @@ -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