diff --git a/README.md b/README.md index d50c38e..6392dac 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This plugin can also be used standalone together with mobx. ## Requirements - __router5 >= 5.0.0__ -- __mobx >= 3.1.0__ +- __mobx >= 4.0.0__ These are considered `peerDependencies` that means they should exist in your installation, you should install them yourself to make this plugin work. The package won't install them as dependencies. @@ -26,16 +26,18 @@ npm install mobx-router5 ## How it works Before using this plugin it is necessary that you understand how [router5 works](http://router5.github.io/docs/understanding-router5.html). -Whenever you performs a router5's transition from one state to another and that transition is *started*, *canceled*, it's *successful* or it has a transition *error* this plugin exposes all this info as [mobx observables](https://mobx.js.org/refguide/observable.html) properties of the `RouterStore` class. You can then use the mobx API to **observe** and react to these **observables**: +Whenever you performs a router5's transition from one state to another and that transition is *started*, *canceled*, it's *successful* or it has a transition *error* +this plugin exposes all this info as [mobx observables references](https://mobx.js.org/refguide/observable.html) properties of the `RouterStore` class. +You can then use the mobx API to **observe** and react to these **observables**: ```javascript -@observable route // the current route -@observable previousRoute -@observable transitionRoute -@observable transitionError -@observable intersectionNode -@observable canActivate -@observable canDeactivate +@observable.ref route; // Current Route - Object +@observable.ref previousRoute; // Object +@observable.ref transitionRoute; // Object +@observable.ref transitionError; // Object +@observable.ref intersectionNode; // String +@observable.ref canActivate; // Array +@observable.ref canDeactivate; // Array ``` @@ -98,20 +100,6 @@ Normally it's **not necessary** to *manually* call these actions, the plugin wil The only one probably worth calling manually (only when necessary) is `clearErrors()`: it resets the `transitionRoute` and `transitionError`. -These actions ensures that these observables properties of the store are always up-to-date with the current state: - -```javascript -@observable route; // Object -@observable previousRoute; // Object -@observable transitionRoute; // Object -@observable transitionError; // Object -@observable intersectionNode; // String -@observable canActivate; // Array -@observable canDeactivate; // Array - -``` - - ### Router instance reference inside the store When you add the plugin to the router with