Created
November 10, 2014 15:05
-
-
Save smt/8a82ed765f5eb491e753 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RouterModel extends Store.Model { | |
constructor() { | |
this.defaults = { | |
route: conf.ROUTE_DEFAULT, | |
params: [] | |
}; | |
super(); | |
} | |
initialize() { | |
this._router = new AppRouter(this, conf.ROUTE_ROUTES); | |
super(); | |
} | |
handleDispatch(payload) { | |
switch (payload.actionType) { | |
case constants.ROUTE_NAVIGATE: | |
this._router.navigate(payload.fragment, { | |
trigger: payload.trigger, | |
replace: payload.replace | |
}); | |
break; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment