From b4a31c86a16aa072b3b903559afca53d2409cae5 Mon Sep 17 00:00:00 2001 From: scott Date: Tue, 3 Nov 2015 15:06:05 +0800 Subject: [PATCH] use alt's magic method use alt's magic method --- store.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/store.js b/store.js index d4db09e50..8b9736bab 100644 --- a/store.js +++ b/store.js @@ -18,12 +18,13 @@ class RouterStore { constructor(){ this.routes = []; this.currentRoute = null; - this.bindAction(actions.init, this.onInit); - this.bindAction(actions.push, this.onPush); - this.bindAction(actions.pop, this.onPop); - this.bindAction(actions.dismiss, this.onDismiss); - this.bindAction(actions.reset, this.onReset); - this.bindAction(actions.replace, this.onReplace); + this.bindActions(actions); //use alt's magic method, it's the same as below + //this.bindAction(actions.init, this.onInit); + // this.bindAction(actions.push, this.onPush); + // this.bindAction(actions.pop, this.onPop); + // this.bindAction(actions.dismiss, this.onDismiss); + // this.bindAction(actions.reset, this.onReset); + // this.bindAction(actions.replace, this.onReplace); } onInit(initial){ @@ -87,4 +88,4 @@ class RouterStore { } -module.exports = alt.createStore(RouterStore, "RouterStore"); \ No newline at end of file +module.exports = alt.createStore(RouterStore, "RouterStore");