diff --git a/.gitignore b/.gitignore
index 0c44ab0..1e2ef9c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,13 +1,185 @@
+# Created by https://www.toptal.com/developers/gitignore/api/dart,intellij,macos,windows
+# Edit at https://www.toptal.com/developers/gitignore?templates=dart,intellij,macos,windows
+
+### Dart ###
+# See https://www.dartlang.org/guides/libraries/private-files
+
# Files and directories created by pub
.dart_tool/
.packages
-
-# Omit commiting pubspec.lock for library packages:
-# https://dart.dev/guides/libraries/private-files#pubspeclock
-pubspec.lock
-
-# Conventional directory for build outputs
build/
+# If you're building an application, you may want to check-in your pubspec.lock
+pubspec.lock
# Directory created by dartdoc
+# If you don't generate documentation locally you can remove this line.
doc/api/
+
+# Avoid committing generated Javascript files:
+*.dart.js
+*.info.json # Produced by the --dump-info flag.
+*.js # When generated by dart2js. Don't specify *.js if your
+ # project includes source files written in JavaScript.
+*.js_
+*.js.deps
+*.js.map
+
+### Intellij ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+# .idea/artifacts
+# .idea/compiler.xml
+# .idea/jarRepositories.xml
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+# *.iml
+# *.ipr
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+### Intellij Patch ###
+# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
+
+# *.iml
+# modules.xml
+# .idea/misc.xml
+# *.ipr
+
+# Sonarlint plugin
+# https://plugins.jetbrains.com/plugin/7973-sonarlint
+.idea/**/sonarlint/
+
+# SonarQube Plugin
+# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
+.idea/**/sonarIssues.xml
+
+# Markdown Navigator plugin
+# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
+.idea/**/markdown-navigator.xml
+.idea/**/markdown-navigator-enh.xml
+.idea/**/markdown-navigator/
+
+# Cache file creation bug
+# See https://youtrack.jetbrains.com/issue/JBR-2257
+.idea/$CACHE_FILE$
+
+# CodeStream plugin
+# https://plugins.jetbrains.com/plugin/12206-codestream
+.idea/codestream.xml
+
+### macOS ###
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+### Windows ###
+# Windows thumbnail cache files
+Thumbs.db
+Thumbs.db:encryptable
+ehthumbs.db
+ehthumbs_vista.db
+
+# Dump file
+*.stackdump
+
+# Folder config file
+[Dd]esktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
+
+# End of https://www.toptal.com/developers/gitignore/api/dart,intellij,macos,windows
\ No newline at end of file
diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml
deleted file mode 100644
index 32f4384..0000000
--- a/.idea/libraries/Dart_Packages.xml
+++ /dev/null
@@ -1,420 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml
deleted file mode 100644
index 32921e3..0000000
--- a/.idea/libraries/Dart_SDK.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index e830069..ee1727b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,7 @@
language: dart
dart:
- - stable
- dev
+ - beta
script:
- dartanalyzer --fatal-infos --fatal-warnings ./lib ./test
- dartfmt -n ./lib --set-exit-if-changed
@@ -29,4 +29,4 @@ after_success:
- bash <(curl -s https://codecov.io/bash)
cache:
directories:
- - $HOME/.pub-cache
\ No newline at end of file
+ - $HOME/.pub-cache
diff --git a/lib/rx_storage.dart b/lib/rx_storage.dart
index 426f68f..a7650ba 100644
--- a/lib/rx_storage.dart
+++ b/lib/rx_storage.dart
@@ -7,6 +7,8 @@ export 'src/impl/real_storage.dart';
export 'src/interface/rx_storage.dart';
export 'src/interface/storage.dart';
export 'src/logger/default_logger.dart';
+export 'src/logger/empty_logger.dart';
+export 'src/logger/event.dart';
export 'src/logger/logger.dart';
-export 'src/logger/logger_adapter.dart';
+export 'src/model/error.dart';
export 'src/model/key_and_value.dart';
diff --git a/lib/src/async_memoizer.dart b/lib/src/async_memoizer.dart
index c05c927..6e0f40f 100644
--- a/lib/src/async_memoizer.dart
+++ b/lib/src/async_memoizer.dart
@@ -31,7 +31,7 @@ class AsyncMemoizer {
///
/// This can be accessed at any time, and will fire once [runOnce] is called.
Future get future => _completer.future;
- final _completer = Completer();
+ late final _completer = Completer();
/// Whether [runOnce] has been called yet.
bool get hasRun => _completer.isCompleted;
diff --git a/lib/src/impl/real_storage.dart b/lib/src/impl/real_storage.dart
index de3336b..bccba2b 100644
--- a/lib/src/impl/real_storage.dart
+++ b/lib/src/impl/real_storage.dart
@@ -1,78 +1,100 @@
import 'dart:async';
-import 'dart:collection';
+import 'package:disposebag/disposebag.dart' hide Logger;
import 'package:meta/meta.dart';
-import 'package:rxdart/rxdart.dart';
+import 'package:rxdart_ext/rxdart_ext.dart';
import '../async_memoizer.dart';
import '../interface/rx_storage.dart';
import '../interface/storage.dart';
+import '../logger/event.dart';
import '../logger/logger.dart';
+import '../model/error.dart';
import '../model/key_and_value.dart';
-import '../stream_extensions/map_not_null.dart';
-import '../stream_extensions/single_subscription.dart';
+
+// TODO(assert)
+// ignore_for_file: unnecessary_null_comparison
/// Default [RxStorage] implementation.
-class RealRxStorage>
- implements RxStorage {
+class RealRxStorage> implements RxStorage {
+ static const _initialKeyValue =
+ KeyAndValue('rx_storage', 'Petrus Nguyen Thai Hoc ');
+
/// Trigger subject
- final _keyValuesSubject = PublishSubject