es2016-base router for react on decorator style
Geek Repo:Geek Repo
Github PK Tool:Github PK Tool
zwhu opened this issue 9 years ago · comments
看了下example,没有跑起来
@zwhu 还没有 push 上来,现在已经好了。你可以试着跑一下,目前实现还是比较简陋的,欢迎 pr
我在看你的源码,刚看的差不多,写的很赞,学习ing。
(⊙o⊙)…,看到 Router 方法中有一些手动 bind 的,可以用 core-decorators 的 autobind 吧。还有在 publish 中 call this ,但是在外部 subscribe 的时候用的是 fat arrow , 所以这个 call this 其实是没多大作用的吧, 也许还打算留到以后有其他作用?
@zwhu 正是因为是箭头函数,所以 call this 才绑定了上下文。不过这部分内容暂时并没有起到作用,只是初步设计。