Skip to content

Commit

Permalink
Change if statement back to switch statement
Browse files Browse the repository at this point in the history
Using a switch with a fall through instead of an if statement. Also found an unnecessary right parenthesis.
  • Loading branch information
cuth committed Jul 29, 2014
1 parent 58e5ac0 commit 09966d5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/Dispatcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,14 @@ The usage of `waitFor()` can be chained, for example:

```
FlightPriceStore.dispatchToken =
flightDispatcher.register(function(payload)) {
if (payload.actionType === 'country-update' || payload.actionType === 'city-update') {
flightDispatcher.waitFor([CityStore.dispatchToken]);
FlightPriceStore.price =
getFlightPriceStore(CountryStore.country, CityStore.city);
flightDispatcher.register(function(payload) {
switch (payload.actionType) {
case 'country-update':
case 'city-update':
flightDispatcher.waitFor([CityStore.dispatchToken]);
FlightPriceStore.price =
getFlightPriceStore(CountryStore.country, CityStore.city);
break;
}
});
```
Expand Down

0 comments on commit 09966d5

Please sign in to comment.