Should flux stores, or actions (or both) touch external services?

前端 未结 6 496
轮回少年
轮回少年 2020-11-28 00:49

Should the stores maintain their own state and have the ability to call network and data storage services in doing so ...in which case the actions are just dumb message pass

6条回答
  •  时光取名叫无心
    2020-11-28 01:28

    If you want one day to have a development environment comparable to what you see in Bret Victor's famous video Inventing on Principle, you should rather use dumb stores that are just a projection of actions/events inside a data structure, without any side effect. It would also help if your stores were actually member of the same global immutable data structure, like in Redux.

    More explainations here: https://stackoverflow.com/a/31388262/82609

提交回复
热议问题