{"id":267521,"date":"2015-11-05T11:21:03","date_gmt":"2015-11-05T08:21:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=267521"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=267521","title":{"rendered":"Not a Flux"},"content":{"rendered":"<p>       \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 Flux, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u043e \u043d\u043e\u0432\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u2014 Not a Flux. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043e Flux.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/347\/fbd\/883\/347fbd8832e24e88873c653f45041eea.jpg\" width=\"400\"\/><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e Flux<\/h2>\n<p>  \u0427\u0442\u043e \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Flux? \u0412\u043a\u0440\u0430\u0442\u0446\u0435: \u044d\u0442\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d, \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 store, dispatcher, view. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e Flux \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c actions.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/568\/e7e\/de6\/568e7ede69044cbda6848e218cb622d2.png\" width=\"800\"\/><\/p>\n<p>  \u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 FLUX \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b react \u0438 MVC.<\/p>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u0438 react, \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442 <a href=\"https:\/\/facebook.github.io\/flux\/docs\/overview.html#views-and-controller-views\">controller view \u0438 view<\/a>.<\/p>\n<p>  Controller view \u044d\u0442\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 view, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0435\u0433\u043e \u0434\u0435\u0442\u0435\u0439, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043e\u0442\u0434\u0430\u0435\u0442 \u0438\u0445 \u0434\u0435\u0442\u044f\u043c \u0432 props. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u044b Facebook \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e \u0432\u043e Flux \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 controller. \u042d\u043c\u043c\u043c\u2026 \u0442\u043e\u0433\u0434\u0430 \u043a\u0442\u043e \u0436\u0435 \u0440\u0438\u0441\u0443\u0435\u0442 view, \u043a\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u0430\u043a\u043e\u0439 view \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c? \u0421\u043b\u0443\u0447\u0430\u0435\u043c \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435 Controller view?<\/p>\n<p>  \u0412 \u043c\u043e\u0434\u0435\u043b\u0438 MVC \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442 \u043d\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0440\u0438\u0441\u0443\u0435\u0442 view. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0438\u0445 \u0432\u043e \u0432\u044c\u044e \u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 view, \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439. \u0427\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u0438 <a href=\"https:\/\/facebook.github.io\/react\/docs\/multiple-components.html\">\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/a>. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u0442\u0435\u0445 \u0442\u0443\u043f\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0438\u043b\u0438 \u043e \u0442\u0435\u0445 \u0442\u0443\u043f\u044b\u0445 \u0432\u044c\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0449\u0435 \u0438 \u0437\u043d\u0430\u044e\u0442 \u043e \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>  Stateless View \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e VIew, \u0447\u0442\u043e \u0436\u0435 \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435? \u0412 \u043d\u043e\u0432\u043e\u043c react \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0445 \u0435\u0449\u0435 \u043f\u0440\u043e\u0449\u0435, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044f \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d jsx, \u0442.\u0435. \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 mvc \u044d\u0442\u043e V (view). \u041d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u043d\u0438 <a href=\"https:\/\/facebook.github.io\/react\/blog\/2015\/10\/07\/react-v0.14.html#stateless-functional-components\">stateless functional components<\/a>.<\/p>\n<p>  \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0432\u043e \u0432\u044c\u044e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 props, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044d\u0442\u0430 View \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0430 View Model, \u0442.\u0435. \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 View.<\/p>\n<p>  \u0421 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 Flux \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0435 Store. \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c M (Model) \u0432 MVC \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435. \u041e\u0442\u043b\u0438\u0447\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0437\u043d\u0430\u0435\u0442 \u043e dispatcher, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e Store \u2014 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u0438 \u0432\u0441\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043a\u0438\u0439 state \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0410 \u0442\u0430\u043a\u0436\u0435, \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u044b Facebook, \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e Store \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043b\u043e\u0433\u0438\u043a\u0443, \u043d\u043e \u043a\u0430\u043a\u0443\u044e?<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 MVC \u0440\u0430\u0437\u043c\u0430\u0437\u0430\u043b\u0438 \u043c\u0435\u0436\u0434\u0443 controller view \u0438 <a href=\"https:\/\/facebook.github.io\/flux\/docs\/overview.html#stores\">Store<\/a>. \u041a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 Backbone \u0438\u043b\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0444\u0440\u0435\u0439\u043c\u0444\u043e\u0440\u043a\u0430\u043c\u0438, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0420\u0435\u0448\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0443\u0442\u044f\u043c\u0438, \u043d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0437\u0430 \u044d\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u043b \u043b\u0438\u0431\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u043b\u0438\u0431\u043e urls, \u043b\u0438\u0431\u043e localStorage.<\/p>\n<p>  \u041a\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c children view, \u043c\u043e\u0436\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044e, \u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0432 \u043d\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c? \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\u0447\u0435\u0440\u0435\u0437 callbacks, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/facebook.github.io\/react\/docs\/transferring-props.html\">props <\/a>\u0438 \u043e\u0431\u0437\u044b\u0432\u0430\u044f <a href=\"https:\/\/facebook.github.io\/react\/tips\/communicate-between-components.html\">\u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438<\/a>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, onChange. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f, \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430: \u043a\u043d\u043e\u043f\u043e\u043a, \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0432, \u0430\u0432\u0442\u043e\u043a\u043e\u043c\u043f\u043b\u0438\u0442\u043e\u0432 \u0438 \u0442\u0434.<\/li>\n<li>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0442\u0442\u0435\u0440 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D0%BE%D1%81%D1%80%D0%B5%D0%B4%D0%BD%D0%B8%D0%BA_(%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD_%D0%BF%D1%80%D0%BE%D0%B5%D0%BA%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F)\">Mediator <\/a>\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c events, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0440\u0435\u0430\u043a\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043b\u0438 actions. \u0414\u0430, \u0438\u043c\u0435\u043d\u043d\u043e mediator \u0432 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%98%D0%B7%D0%B4%D0%B0%D1%82%D0%B5%D0%BB%D1%8C-%D0%BF%D0%BE%D0%B4%D0%BF%D0%B8%D1%81%D1%87%D0%B8%D0%BA_(%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD_%D0%BF%D1%80%D0%BE%D0%B5%D0%BA%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F)\">pub-sub<\/a> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u043e\u043b\u044c \u043d\u0435\u043a\u043e\u0439 \u0442\u0440\u0443\u0431\u044b, \u043a\u0443\u0434\u0430 \u0441\u044b\u043f\u044f\u0442\u0441\u044f \u043a\u0443\u0447\u0430 \u0438\u0432\u0435\u043d\u0442\u043e\u0432, \u0430 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0435 \u0438\u0432\u0435\u043d\u0442\u044b \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438. \u0412 FLUX \u044d\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/facebook.github.io\/flux\/docs\/overview.html#what-about-that-dispatcher\">Dispatcher<\/a>.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u041e\u0431 Actions<\/h2>\n<p>  <a href=\"https:\/\/facebook.github.io\/flux\/docs\/overview.html#actions\">Action<\/a> \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u0438 react \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0441\u0430\u043c\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 event \u0432 pub-sub.<\/p>\n<h2>\u0422\u0435\u043f\u0435\u0440\u044c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/h2>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/facebook.github.io\/flux\/docs\/todo-list.html#source-code-structure\">TODO<\/a> \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 Flux. \u0422\u0430\u043c \u043e\u0442\u0447\u0435\u0442\u043b\u0438\u0432\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/facebook.github.io\/flux\/docs\/todo-list.html#listening-to-changes-with-a-controller-view\">\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0435, \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043b\u0435\u0437\u0435\u0442 \u0432 store (\u043c\u043e\u0434\u0435\u043b\u044c), \u0442\u043e\u0447\u043d\u0435\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442 \u043d\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u044f pub-sub \u0438 \u043a\u0438\u0434\u0430\u0435\u0442 \u0438\u0445 \u043d\u0443\u0436\u043d\u044b\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c \u0447\u0435\u0440\u0435\u0437 props. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0442\u0430\u043a \u044d\u0442\u043e \u0437\u0430\u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0435 \u0437\u043d\u0430\u0442\u044c \u043e Dispatcher \u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445? \u041a\u0430\u043a \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 View? \u041a\u0443\u0434\u0430 \u0433\u0438\u0431\u0447\u0435, \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c callback, \u0430 \u0443\u0436\u0435 \u0432 parent View \u043a\u0438\u0434\u0430\u0442\u044c, \u0447\u0442\u043e-\u0442\u043e \u0432 Dispatcher.<\/p>\n<p>  \u0422\u0430\u043a \u0447\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 Flux? Flux \u2014 \u044d\u0442\u043e \u043d\u0435 \u0447\u0442\u043e \u0438\u043d\u043e\u0435, \u043a\u0430\u043a \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 MVC\/MVVM \u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Mediator. \u0422\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u044c \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u044d\u0442\u043e \u0438 \u0442\u0430\u043a \u044f\u0441\u043d\u043e, \u0437\u0430\u0447\u0435\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0437\u043d\u0430\u0442\u044c \u043e \u043c\u043e\u0434\u0435\u043b\u0438, \u0438\u043d\u0430\u0447\u0435 \u0438\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0436\u0438\u0437\u043d\u0438<\/h2>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 Not a Flux \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430 react.<\/p>\n<h2>P.S.<\/h2>\n<p>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442 Flux \u043d\u043e\u0432\u0448\u0435\u0441\u0442\u0432\u043e\u043c \u0438 \u0438\u0449\u0435\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e Flux, \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435, Flux for stupids, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d Not a Flux, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0438\u0437 \u0434\u0432\u0443\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432: Brain \u0438 Design patterns. <\/p>\n<p>  \u041a\u0430\u043a\u043e\u0439 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434? \u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0430\u0434\u043e \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043d\u0435 flux \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043d\u0430 react, \u0430 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043e\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0449\u0438\u043c\u0438 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u041f\u041e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b, \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 (\u0444\u0430\u0431\u0440\u0438\u043a\u0438) \u0438 \u0434\u0440. Flux \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0437\u043d\u0430\u044f \u044d\u0442\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043b\u0430\u0434\u0438\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041a\u0440\u0438\u0442\u0438\u043a\u0430 \u043f\u043e \u0434\u0435\u043b\u0443 \u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f.<\/p>\n<h2>\u041b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0430<\/h2>\n<p>  \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043a \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044e \u043f\u0430\u0440\u0443 \u043a\u043d\u0438\u0433 (\u0441\u0441\u044b\u043b\u043a\u0438 \u0441\u0430\u043c\u0438 \u0437\u043d\u0430\u0435\u0442\u0435 \u0433\u0434\u0435 \u043d\u0430\u0439\u0442\u0438), \u0435\u0441\u043b\u0438 \u043a\u0442\u043e \u043d\u0435 \u0447\u0438\u0442\u0430\u043b \u0438\u0445:<\/p>\n<ul>\n<li>Learn Javascript Design Patterns \u043e\u0442 Addy Osmani<\/li>\n<li>Javascript Patterns \u043e\u0442 Stoyan Stefanov<\/li>\n<li>\u041e <a href=\"https:\/\/facebook.github.io\/react\/\">ReactJS<\/a><\/li>\n<li>\u041e <a href=\"https:\/\/facebook.github.io\/flux\/\">Flux<\/a><\/li>\n<\/ul>\n<p>  * \u0412\u0441\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432\u0437\u044f\u0442\u044b \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/270193\/\"> http:\/\/habrahabr.ru\/post\/270193\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e\u0431 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 Flux, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u043e \u043d\u043e\u0432\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u2014 Not a Flux. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043e Flux.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/347\/fbd\/883\/347fbd8832e24e88873c653f45041eea.jpg\" width=\"400\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-267521","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/267521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=267521"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/267521\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=267521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=267521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=267521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}