参考示例React.js Flux教程项目Part 1: Building web app using react.js, express.js, node.js and mongodb,理解为什么依赖调用似乎并不总是遵循与箭头的方向相同的正相关或负相关将是有帮助的。 Flux流程图如下所示(注意调用与箭头相反的情况):
通量图来源:https://facebook.github.io/flux/docs/overview.html
“查看”类别中的模块包括:
main.jsx (View calls Store in OPPOSITE direction of arrow as well as other view components)
components/SchoolsList.jsx (View calls other View components)
components/SchoolsInfo.jsx (View calls Action in direction of arrow)
components/AddSchool.jsx (View calls Action in direction of arrow)
“行动”类别中的模块包括:
dispatcher.js (Action calls Dispatcher in direction of arrow)
“Dispatcher”类别中的模块包括:
dispatcher.js (Does not call other Flux blocks. Only call is to guid lib)
“商店”类别中的模块包括:
schoolStore.js (Store calls Dispatcher in the OPPOSITE direction of arrow)
要清楚,问题是依赖调用如何映射到箭头?特别是,看到一个解释可以协调箭头方向与依赖调用的不一致相关性会很有帮助。