Observable<int>
you can now write ObservableInt
..asObservable()
extension for primitive types.var name = ''.asObservable(); // infers ObservableString var counter = 0.asObservable(); // infers ObservableInt
toggle()
method for ObservableBool
. Lets you toggle the internal value of ObservableBool
var lights = true.asObservable(); lights.toggle(); // now it has a value of falseChanges made by @subzero911
ObservableStream.listen()
should also keep observable values updated (#708) - @brianrobles204asyncWhen
- @easeccyanalyzer
package to 2.0.0
- @davidmartos96Computed
that was not propagating values after an exception - @brianrobles204mockito
as a dependency and using mocktail
instead.@readonly
annotation support for creating read-only observables.@readonly
annotation, as per this issueobserve()
API for ObservableList
. We now get better change events with accurate details about what has changed. Thanks to @darkstarx for the PR (#490)spy()
to see all these changes. See this for an example.test_coverage
package, which was causing issues on CI.EqualityComparer<T>
can now be specified for Computed<T>
. This can be passed in with the equals
parameter in the constructor.MobXCaughtException
. Previously they were reported as-is and that caused issues in flutter_mobx
, where the stack traces were not visible. The stack trace is now being captured as part of the exception, so flutter_mobx
can show the complete trace. This helps a lot during debugging.MobXException
now extends from Error
to capture the stack trace. This is done because Dart only captures stack traces automatically for Error
instances.1.1.1
@StoreConfig
annotation (@hawkbee1)test_coverage
packageauthors
field from pubspec.yaml
README.md
translated to Portuguese, thanks to Jacob MouraStore.dispose
unused_element
toString
override for MobXException
ObservableValue
that is a common interface for all observables: Observable
, Computed
, ObservableFuture
, ObservableStream
. Thanks to @t-artikovdart:ui
Store
classes referenced in the @store
based generationThanks to @shyndman for the tremendous work on this release.
pubspec.yaml
Store
classes using the @store
annotation. This will exist as an alternative to the mixin based approach we already have.reaction
for using a custom EqualityComparator<T, T>
. This is useful when you want to avoid expensive reactions by plugging in a custom comparison function for the previous and next values of the predicate.ObservableFuture<T>
would not show the correct status. This was happening because of the lazy evaluation strategy. We are now being eager in creating the status and monitoring the inner Future<T>
immediately.test_coverage
@experimental
annotations for Observable{Future,Stream}
and reaction
.meta
package.enforceActions
setting of ReactiveConfig
. It is now called writePolicy
and the enum EnforceActions
has been renamed to ReactiveWritePolicy
.readPolicy
setting on ReactiveConfig
. It is an enumeration with two values:ReactiveWritePolicy
is violated. This was a vestige from the mobx.js
world.isWithinBatch
on ReactiveContext
, which tells if the current code is running inside a batch. This is used to conditionally apply an action-wrapper for mobx_codegen
-generated setters.conditionallyRunInAction()
that runs the given function in an action only when outside a batch.enum ReactiveReadPolicy { always, never }
beta
/dev
/master
channels.Store
type. Previously it was meant to be used as an interface, which has now changed to a mixin. Instead of doing:abstract class UserBase implements Store {}
You now do:
abstract class UserBase with Store {}
This allows us to add more convenience methods to the Store
mixin without causing any breaking change in the future. With the current use of the interface, this was not possible and was limiting the purpose. Store
was just a marker interface without any core functionality. With a mixin, it opens up some flexibility in adding more functionality later.
Store
mixin.