trazyn / ieaseMusic

网易云音乐第三方
MIT License
8.78k stars 995 forks source link

自定义注入(Customizing inject)是否有加observer装饰器的必要? #388

Open sincerexie opened 5 years ago

sincerexie commented 5 years ago

你好!我注意到mobx-react文档里有个注解,如果使用了自定义注入(Customizing inject),则不需要再加observer装饰器,但我看到了本项目中使用了inject mapperFunction的地方,都有加observer装饰器,这是否必要呢?

文档中的注解:

N.B. note that in this specific case neither NameDisplayer nor UserNameDisplayer needs to be decorated with observer, since the observable dereferencing is done in the mapper function

具体地址:mobx-react#customizing-inject

trazyn commented 5 years ago

不是必要的