{"id":319584,"date":"2021-03-15T09:00:50","date_gmt":"2021-03-15T09:00:50","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=319584"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=319584","title":{"rendered":"\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b Redux \u043d\u0430 MobX. \u0427\u0430\u0441\u0442\u044c 2: \u00ab\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 MobX\u00bb"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p><a href=\"https:\/\/habr.com\/ru\/post\/546606\/\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438: \u00ab\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 Redux\u00bb.<\/a><\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u043e\u043f\u0438\u0448\u0443, \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0430\u043a\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. MobX \u0432\u0437\u044f\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 Observer, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430.<\/p>\n<p>\u042f \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u0447\u0438\u0442\u0430\u043b, \u043a\u0430\u043a \u043a\u0442\u043e-\u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b MobX, \u0443 \u043d\u0435\u0433\u043e \u043a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u043c \u0441 \u043d\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u043d \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 Redux. \u0414\u043b\u044f MobX \u043d\u0435\u0442 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u041d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0438 \u0432 MobX \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u0438 \u043e\u0434\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0439 (\u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430) \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0441\u043a\u043e\u043b\u044c \u0443\u0433\u043e\u0434\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u042f \u043e\u043f\u0438\u0448\u0443 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043a\u0430\u043a \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f. \u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 5 \u043b\u0435\u0442 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 REST-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 API, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u043f\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 REST API.<\/p>\n<p>\u0411\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u043e\u0438. \u041c\u043e\u044f \u0446\u0435\u043b\u044c &#8212; \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u043e\u0439 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0432 Redux, \u0430 \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0449\u0435.<\/p>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u0435\u043b. <br \/>\u041a\u043e\u0434 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. \u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/github.com\/sergeysibara\/mobx-react-4-layer-architecture\" rel=\"noopener noreferrer nofollow\">github<\/a> \u0438 \u0432 <a href=\"https:\/\/codesandbox.io\/s\/mobx-react-4-layer-architecture-cko6u\" rel=\"noopener noreferrer nofollow\">codesanbox<\/a>. <br \/>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043f\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 &#8212; <a href=\"https:\/\/softwareengineering.stackexchange.com\/a\/338610\" rel=\"noopener noreferrer nofollow\">Folder-by-<strong>feature<\/strong><\/a>. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043e\u0431\u0449\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0432\u0440\u043e\u0434\u0435 ducks\/stores, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u0440\u0435\u0434\u044c\u044e\u0441\u0435\u0440\u044b\/actions\/stores, \u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043f\u043e\u043a \u0443 \u0432\u0430\u0441 \u0432\u0440\u044f\u0434 \u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0432\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435. \u0421\u0443\u0442\u044c \u0442\u0430\u043a\u0430\u044f, \u0447\u0442\u043e \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 feature\/\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0440\u044f\u0434\u043e\u043c \u0441 \u043d\u0435\u0439, \u0430 \u043d\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p><strong>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"#store-layer\" rel=\"noopener noreferrer nofollow\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u043e\u044f \u0441\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 MobX<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#api\" rel=\"noopener noreferrer nofollow\"><strong>\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 (API \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b)<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#controller\" rel=\"noopener noreferrer nofollow\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u043e\u044f controller (\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 middleware \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435)<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#initialization\" rel=\"noopener noreferrer nofollow\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u043e\u0440\u043e\u0432, api \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#component\" rel=\"noopener noreferrer nofollow\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u0430 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#conclusion\" rel=\"noopener noreferrer nofollow\"><strong>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0421\u0445\u0435\u043c\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b<\/strong><\/a><\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"store-layer\" id=\"store-layer\"><\/a><\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u043e\u044f \u0441\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 MobX<\/h2>\n<p>\u041a\u0430\u043a \u0438 \u0432 Redux, \u044d\u0442\u043e\u0442 \u0441\u043b\u043e\u0439 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u043e\u0435\u0432.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u043e\u0440\u043e\u0432 &#8212; \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c, \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u043e\u0440\u043c\u043e\u0439, \u0442\u0440\u0435\u0442\u0438\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 (\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430, \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f). \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0430. \u041d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0442\u044c \u0441\u0442\u043e\u0440 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 feature \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u0430. \u0411\u0435\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0431\u044b \u0442\u0430\u043a: &#171;BaseStore&lt;TListItem, TEditItem, TSearchParams&gt;&#187;, \u0447\u0442\u043e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u0442 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0414\u043b\u044f \u0441\u0442\u043e\u0440\u043e\u0432 \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 (API, middleware) \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b. \u041d\u0430 github \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 todos (\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b\/feature) \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0442 \u043a\u043e\u0434\u0430 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 api.js, controllers.js, stores.js, \u0442.\u043a. \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u0432 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b, \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0412 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0438\u0445, \u0442.\u043a. \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442\u044c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b, \u0430 \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041a\u043b\u0430\u0441\u0441\u044b \u0437\u0434\u0435\u0441\u044c \u0443\u0434\u043e\u0431\u043d\u044b \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0437\u0430\u0434\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043e\u0431\u0449\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u043c\u0435\u043d\u0435\u0435 \u0432\u0430\u0436\u043d\u043e, \u043a\u0430\u043a \u0441\u043b\u043e\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438. \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u0441\u043b\u043e\u0438 API, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432  (\u043e \u043d\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043f\u043e\u0437\u0436\u0435), \u0441\u0442\u043e\u0440\u043e\u0432 \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u044b \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0442\u043e\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">\/\/ \u041e\u0431\u0449\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \/\/ src\/core\/types\/index.ts export type ObjectType = Record&lt;string, unknown&gt; | null | undefined; export type ErrorType = string | ObjectType; export interface IIdentifiable { id: number; }<\/code><\/pre>\n<pre><code class=\"javascript\">\/\/ \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0441\u0442\u043e\u0440\u043e\u0432, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \/\/ src\/core\/store\/BaseListStore.ts import { observable, action, computed, makeObservable } from 'mobx'; import { ErrorType, ObjectType, IIdentifiable } from 'core\/types';  export interface IListState&lt;TListItem extends IIdentifiable&gt; {   results: TListItem[];   count?: number; \/\/ \u0447\u0438\u0441\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043f\u044d\u0439\u0434\u0436\u0438\u043d\u0433\u0430.   isLoading?: boolean;   error?: ErrorType; }  export default class BaseListStore&lt;TListItem extends IIdentifiable&gt; {   @observable   protected listState: IListState&lt;TListItem&gt; = {     results: [],   };    constructor() {     makeObservable&lt;BaseListStore&lt;TListItem&gt;&gt;(this);   }    @computed   get list(): TListItem[] {     return Array.isArray(this.listState.results)         ? this.listState.results         : [];   }    @action   setListState(list: IListState&lt;TListItem&gt;) {     this.listState = list;   }    @action   addToList(item: TListItem) {     this.list.push(item);   }    @action   updateListItem(item: TListItem) {     const foundTodo = this.list.find((i) =&gt; item &amp;&amp; i.id === item.id);     if (foundTodo &amp;&amp; item) {       Object.assign(foundTodo, item);     }   }   ... }  \/\/ \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0438\u043f \u0441\u0442\u043e\u0440\u0430 export type BaseListStoreType = BaseListStore&lt;IIdentifiable&gt;;<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 Todo. \u041f\u043e\u043a\u0430-\u0447\u0442\u043e \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0441\u043f\u0438\u0441\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c BaseListStire&lt;T&gt;.<\/p>\n<pre><code class=\"javascript\">\/\/ src\/pages\/todos\/stores.tsx import { IIdentifiable } from 'core\/types';  export interface ITodoModel extends IIdentifiable {   title: string;   completed: boolean; }  export type TodoListStoreType = BaseListStore&lt;ITodoModel&gt;;<\/code><\/pre>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"api\" id=\"api\"><\/a><\/p>\n<h2>\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 (API \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b)<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u043d\u0435 \u0437\u0430\u0441\u043e\u0440\u044f\u0442\u044c \u043a\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 axios. \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u043e\u044f\u0445. \u041e\u043d \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0442\u043e\u0440 \u0438\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e. \u0412 Redux \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043f\u0440\u043e \u044d\u0442\u043e\u0439 \u0441\u043b\u043e\u0439, \u043d\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u0435\u0433\u043e, \u043a\u0430\u043a \u0438 \u044f.<\/p>\n<p>\u0412 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f axios \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441. \u0422.\u043a. \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u043f\u043e\u043b\u044c\u0437\u044b \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0432\u0438\u0434\u043d\u043e. \u041d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u044d\u0442\u043e \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438\u043b\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0438\u043b\u0438 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438. <\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e api \u0441\u0435\u0440\u0432\u0438\u0441\u044b. \u041d\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b. <\/p>\n<details class=\"spoiler\">\n<summary>core\/api\/apiService.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; import { ObjectType } from '..\/types';  axios.defaults.baseURL = process.env.REACT_APP_BASE_API_URL;  export type ApiServiceResponseType = Promise&lt;AxiosResponse&lt;any&gt;&gt;;  const apiService = {   get: function (     url: string,     config?: AxiosRequestConfig,   ): ApiServiceResponseType {     return axios.get(url, config);   },    post: function (     url: string,     data: ObjectType,     config?: AxiosRequestConfig,   ): ApiServiceResponseType {     return axios.post(url, data, config);   },    patch: function (     url: string,     data: ObjectType,     config?: AxiosRequestConfig,   ): ApiServiceResponseType {     return axios.patch(url, data, config);   },    delete: function (     url: string,     config?: AxiosRequestConfig,   ): ApiServiceResponseType {     return axios.delete(url, config);   }, };  export default apiService;<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 apiService. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0442\u043e\u0436\u0435 \u0447\u0430\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f.<\/p>\n<details class=\"spoiler\">\n<summary>core\/api\/BaseApi.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">import apiService from '.\/apiService'; import { IResponseList, IResponseModel, IResponseError } from '.\/types'; import { IIdentifiable, ObjectType } from '..\/types';  export default class BaseApi&lt;T extends IIdentifiable&gt; {   private readonly _apiUrl: string;    get apiUrl(): string {     return this._apiUrl;   }    constructor(apiUrl: string) {     this._apiUrl = apiUrl;   }    async getList(     params?: ObjectType,   ): Promise&lt;IResponseList&lt;T&gt; | IResponseError&gt; {     try {       const ret = await apiService.get(this._apiUrl, { params });       return { results: ret.data || [] };     } catch (error) {       return this.handleError(error);     }   }    async update(     modelData: { id: number },     params?: ObjectType,   ): Promise&lt;IResponseModel&lt;T&gt; | IResponseError&gt; {     try {       const ret = await apiService.patch(         `${this._apiUrl}\/${modelData.id}`,         modelData,         { params },       );       return { model: ret.data };     } catch (error) {       return this.handleError(error);     }   }    protected handleError(e): IResponseError {     let message = '';     if (e.response) {       message = e.message;     }      return { isError: true, message };   } }  export type BaseApiType = BaseApi&lt;IIdentifiable&gt;;<\/code><\/pre>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"controller\" id=\"controller\"><\/a><\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u043e\u044f controller (\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 Redux middleware \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435)<\/h2>\n<p><strong>\u0412 \u0441\u0432\u043e\u0435\u043c \u043a\u043e\u0434\u0435 \u0432\u043c\u0435\u0441\u0442\u043e middleware \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d \u0438\u0437 MVC &#8212; Controller.<\/strong> \u0412 Redux \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c middlewares \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0438. \u0422.\u043a. \u044d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e, \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0438 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b \u0443 \u0441\u0435\u0431\u044f \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0438. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0435 \u041f\u041e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u043b\u0438 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 API \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440. \u0422\u0430\u043a \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u0432\u043e\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0432\u043f\u0435\u0440\u0435\u043c\u0435\u0448\u043a\u0443.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 &#8212; \u0431\u044b\u0442\u044c \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a\u043e\u043c \u043c\u0435\u0436\u0434\u0443 api, \u0441\u0442\u043e\u0440\u043e\u043c \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c. \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c api \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043b\u043e\u0433\u0438\u043a\u0443, \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430, \u043a\u0430\u043a\u043e\u0439 api \u043c\u0435\u0442\u043e\u0434 \u0438 \u0441\u0442\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440. \u041e\u0431\u0449\u0443\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 api. \u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0441\u0442\u043e\u0438\u0442 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f \u043a \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u043e\u0435 View (\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b) \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445.  \u042d\u0442\u043e\u0442 \u0441\u043b\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c \u043e\u0442 \u0441\u043b\u043e\u044f \u0441\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u043b\u043e\u044f API.<\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u0449\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u0430 \u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u043c\u0438 CRUD \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>src\/core\/controllers\/BaseController.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">import { BaseStoreType } from '..\/store\/BaseStore'; import { SearchParamsStoreType } from '..\/store\/SearchParamsStore'; import { BaseApiType } from '..\/api\/BaseApi'; import IIdentifiable from '..\/types\/IIdentifiable'; import ObjectType from '..\/types\/ObjectType'; import { isIResponseError } from '..\/api\/types'; import { toast } from 'react-toastify';  export default class BaseController {   private readonly _mainStore: BaseStoreType;   private readonly _searchParamsStore: SearchParamsStoreType;   private readonly _api: BaseApiType;    constructor(mainStore: BaseStoreType,                searchParamsStore: SearchParamsStoreType,                api: BaseApiType) {     this._mainStore = mainStore;     this._searchParamsStore = searchParamsStore;     this._api = api;   }    async getList() {     const searchParams = this._searchParamsStore.getSearchParamsMergedToJS();     const response = await this.api.getList(searchParams);     if (isIResponseError(response)) {       toast.error(response.message);     } else {       this.listStore.setListState({         results: response.results,         count: response.count,       });     }   }    async create(modelData: ObjectType) {     const response = await this.api.create(modelData);     if (isIResponseError(response)) {       toast.error(response.message);     } else {       await this.getList(); \/\/ for apply filters     }   }    setFilters = (filters: ObjectType) =&gt; {     this.searchParamsStore.setFilters(filters);   };   ... }<\/code><\/pre>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"initialization\" id=\"initialization\"><\/a><\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u043e\u0440\u043e\u0432, api \u0438 controllers<\/h2>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0441\u0442\u043e\u0440\u043e\u0432, api \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u0441\u0442\u043e\u0440\u043e\u0432 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u043c\u043e\u043a\u0430\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 \u0442\u0435\u0441\u0442\u0430\u0445, \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<details class=\"spoiler\">\n<summary>src\/contexts.ts + src\/App.tsx<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">import { createContext } from 'react'; import BaseListStore from 'core\/store\/BaseListStore'; import BaseEditStore from 'core\/store\/BaseEditStore'; import SearchParamsStore from 'core\/store\/SearchParamsStore'; import {   TodoListStoreType,   TodoEditStoreType,   TodoSearchParamsStoreType, } from '.\/pages\/todos\/stores'; import { createTodoAPI } from '.\/pages\/todos\/api'; import BaseController from 'core\/\u0441ontrollers\/BaseController'; import TodoPage from '.\/pages\/todos\/views\/Page';  export interface IStoresContextValue {   todoListStore: TodoListStoreType;   todoEditStore: TodoEditStoreType;   todoSearchParamsStore: TodoSearchParamsStoreType; }  export const StoresContext =    createContext&lt;IStoresContextValue | null&gt;(null)    as Context&lt;IStoresContextValue&gt;;  export const stores: IStoresContextValue = {   todoListStore: new BaseListStore(),   todoEditStore: new BaseEditStore(),   todoSearchParamsStore: new SearchParamsStore(), };  export interface IControllersContextValue {   todoController: BaseController; }  export const ControllersContext =    createContext&lt;IControllersContextValue | null&gt;(null)    as Context&lt;IControllersContextValue&gt;;  export const controllers: IControllersContextValue = {   todoController: new BaseController(     stores.todoListStore,     stores.todoEditStore,     stores.todoSearchParamsStore,     createTodoAPI('\/todos'),   ), };  const App = () =&gt; {   return (     &lt;div&gt;       &lt;StoresContext.Provider value={stores}&gt;         &lt;ControllersContext.Provider value={controllers}&gt;           &lt;TodoPage \/&gt;         &lt;\/ControllersContext.Provider&gt;       &lt;\/StoresContext.Provider&gt;     &lt;\/div&gt;   ); };<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e \u0441\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0430 \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 context. \u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u0438\u0436\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043d\u0435\u0442. <br \/>\u041f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0441 \u043f\u043e\u0434\u043c\u0435\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u0432 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438 \u0431\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Jest, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b &#171;sr\u0441\/pageA\/myStore.js&#187;, \u0442\u043e \u0432 \u043f\u0430\u043f\u043a\u0435 pageA \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 __mocks__  \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043d\u0435\u0439 \u0444\u0430\u0439\u043b myStore.js \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0435\u0433\u043e \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0422\u043e \u0435\u0441\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u043f\u0443\u0442\u0438: &#171;sr\u0441\/pageA\/__mocks__ \/myStore.js&#187;. \u0410 \u0432 \u0444\u0430\u0439\u043b\u0435 \u0441 \u0442\u0435\u0441\u0442\u043e\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: &#171;sr\u0441\/pageA\/__tests__ \/MyComponent.js&#187;) \u043f\u043e\u0441\u043b\u0435 import-\u043e\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c &#171;jest.mock(&#8216;..\/myStore&#8217;);&#187;.<\/p>\n<p><a class=\"anchor\" name=\"component\" id=\"component\"><\/a><\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u0430 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445<\/h3>\n<details class=\"spoiler\">\n<summary>src\/pages\/todos\/views\/List.jsx<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">import { useEffect, useContext } from 'react'; import List from '@material-ui\/core\/List'; import ListItem from '@material-ui\/core\/ListItem'; import { observer } from 'mobx-react-lite'; import { ControllersContext, StoresContext } from 'contexts'; import { ITodoModel } from '..\/stores';  const TodoList = observer(() =&gt; {   const { todoListStore } = useContext(StoresContext);   const { todoController } = useContext(ControllersContext);      const handleChange = (item) =&gt; {     todoController.update({       id: item.id,       completed: !item.completed,     } as ITodoModel);   };      useEffect(() =&gt; {     todoController.getList();   }, []);   return (     &lt;List&gt;       {todoListStore.list.map((item) =&gt; (         &lt;ListItem key={item.id} dense button&gt;           ...         &lt;\/ListItem&gt;       ))}     &lt;\/List&gt;   ); });  export default TodoList;<\/code><\/pre>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"conclusion\" id=\"conclusion\"><\/a><\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0421\u0445\u0435\u043c\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b<\/h2>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c\u0438: <\/p>\n<ul>\n<li>\n<p>Service (\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u043e\u0431\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432) <\/p>\n<\/li>\n<li>\n<p>Controller (\u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 API, \u0441\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438) <\/p>\n<\/li>\n<li>\n<p>Store (\u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 (\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c) \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f) <\/p>\n<\/li>\n<li>\n<p>View (\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b)<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0435\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0441 Redux:<\/p>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"93\" width=\"93\">\n<p><strong>Redux<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>Services (\u043e\u043f\u0446\u0438\u043e-\u043d\u0430\u043b\u044c\u043d\u043e)<\/p>\n<\/td>\n<td data-colwidth=\"94\" width=\"94\">\n<p>Middle-ware&#8217;s <\/p>\n<\/td>\n<td data-colwidth=\"93\" width=\"93\">\n<p>Action creators<\/p>\n<\/td>\n<td data-colwidth=\"88\" width=\"88\">\n<p>Actions<\/p>\n<\/td>\n<td data-colwidth=\"102\" width=\"102\">\n<p>Reducers<\/p>\n<\/td>\n<td>\n<p>Selectors<\/p>\n<\/td>\n<td>\n<p>Compo-nents<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"93\" width=\"93\">\n<p><strong>\u043c\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"95\" width=\"95\">\n<p>Services<\/p>\n<\/td>\n<td colspan=\"3\" data-colwidth=\"94,93,88\" width=\"94\">\n<p>Controllers \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438-\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c\u0438<\/p>\n<\/td>\n<td colspan=\"2\" data-colwidth=\"102,0\" width=\"102\">\n<p>Stores \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c\u0438  \u0441\u0435\u0442\u0442\u0435\u0440\u0430\u043c \u0438 \u0433\u0435\u0442\u0442\u0435\u0440\u0430\u043c.<\/p>\n<\/td>\n<td>\n<p>Compo-nents<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e 7-\u043c\u0438 \u0432\u0438\u0434\u043e\u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c 4-\u0440\u0435. \u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0436\u0435.<\/p>\n<p><strong>\u041d\u0438\u0436\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044b 2 \u0441\u0445\u0435\u043c\u044b:<\/strong><br \/><strong>1) \u0421\u0445\u0435\u043c\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, <\/strong>\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0430\u044f, \u043a\u0430\u043a\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0430\u043a\u0430\u044f-\u0442\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p><strong>2) \u0421\u0445\u0435\u043c\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, <\/strong>\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0430\u044f \u0438\u0437 \u043a\u0430\u043a\u0438\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043a\u0430\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0434 &#171;get&#187; \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u0430 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043f\u043e\u0434 &#171;pass&#187; \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u0434\u0440\u0443\u0433\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/04e\/18b\/b5d\/04e18bb5db39d7d9a37cfc11b5e750bf\" width=\"1089\" height=\"587\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044e MV* \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u0430. \u0412\u043c\u0435\u0441\u0442\u043e View Model \u043a\u0430\u043a \u0432 MVVM, \u0437\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u043e\u0440, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0436\u0435 &#8212; \u043e\u0431\u044b\u0447\u043d\u043e\u0435 MVC.<\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0441 2016 \u0433\u043e\u0434\u0430. \u042f \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0442\u043e\u043c\u0443 \u0432\u0438\u0434\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0441\u0442\u0430\u0442\u044c\u0435. \u0427\u0442\u043e-\u0442\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u043b \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435. \u0427\u0442\u043e-\u0442\u043e \u0441\u0430\u043c \u0440\u0435\u0448\u0438\u043b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c. \u0427\u0442\u043e-\u0442\u043e \u0435\u0449\u0435 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0431\u0443\u0434\u0443 \u043c\u0435\u043d\u044f\u0442\u044c.<\/p>\n<p>\u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b.<\/p>\n<p><strong>1. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043e\u0434\u0438\u043d \u0441\u0442\u043e\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0430?<br \/><\/strong>\u042f \u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u044f \u043f\u0435\u0440\u0435\u0434\u0430\u044e \u044d\u0442\u0443 \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c  \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443. \u0412 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u0440, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u0440.<\/p>\n<p><strong>2. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0430 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0430 \u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0430?<\/strong><br \/>\u042f \u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0445 \u0446\u0435\u043f\u043e\u0447\u0435\u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0438 \u0432\u044b\u043d\u043e\u0448\u0443 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440. \u0422\u043e \u0435\u0441\u0442\u044c <br \/>\u0438\u0437 \u0441\u0442\u043e\u0440\u043e\u0432 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e \u0438\u0445, \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u044e \u0438\u0445 \u0441\u0442\u043e\u0440\u0430\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u043c \u044d\u0442\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p><strong>3. \u0415\u0441\u043b\u0438 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0442\u043e\u0440\u043e\u0432<\/strong>, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u041c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c custom hook \u0438\u043b\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 MobX &#8212; computed. \u0421\u043f\u0430\u0441\u0438\u0431\u043e <a href=\"https:\/\/habr.com\/ru\/users\/DmitryKazakov8\/\" rel=\"noopener noreferrer nofollow\">@DmitryKazakov8<\/a><a href=\"@DmitryKazakov8\" rel=\"noopener noreferrer nofollow\"> <\/a>\u0437\u0430 \u0435\u0433\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438! \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e \u0440\u0435\u0448\u0438\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0443\u043d\u043a\u0442.<\/p>\n<p><strong>4. \u0423\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430. <\/strong><\/p>\n<p>\u0412 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435, \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u0441\u0442\u043e\u0440\u043e\u0432, api. <br \/>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0447\u0435\u0440\u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0435:<br \/><a href=\"https:\/\/github.com\/sergeysibara\/mobx-react-4-layer-architecture\/blob\/wrap-feature\/src\/core\/wrapFeature.ts\" rel=\"noopener noreferrer nofollow\">wrapFeature.ts<\/a> (\u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445, \u043b\u0438\u0431\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 api, stores, controller \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 feature \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0445)<br \/><a href=\"https:\/\/github.com\/sergeysibara\/mobx-react-4-layer-architecture\/blob\/wrap-feature\/src\/contexts.ts#L43\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/a><\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0443\u0441\u0435\u0440\u0434\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 context \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c import\/export, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430.<\/p>\n<\/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=\"https:\/\/habr.com\/ru\/post\/546628\/\"> https:\/\/habr.com\/ru\/post\/546628\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p><a href=\"https:\/\/habr.com\/ru\/post\/546606\/\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438: \u00ab\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 Redux\u00bb.<\/a><\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u043e\u043f\u0438\u0448\u0443, \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0430\u043a\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. MobX \u0432\u0437\u044f\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 Observer, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430.<\/p>\n<p>\u042f \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u0447\u0438\u0442\u0430\u043b, \u043a\u0430\u043a \u043a\u0442\u043e-\u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b MobX, \u0443 \u043d\u0435\u0433\u043e \u043a\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u043c \u0441 \u043d\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u043d \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 Redux. \u0414\u043b\u044f MobX \u043d\u0435\u0442 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u041d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0438 \u0432 MobX \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u0438 \u043e\u0434\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0439 (\u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430) \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0441\u043a\u043e\u043b\u044c \u0443\u0433\u043e\u0434\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u042f \u043e\u043f\u0438\u0448\u0443 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043a\u0430\u043a \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f. \u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 5 \u043b\u0435\u0442 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 REST-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 API, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u043f\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 REST API.<\/p>\n<p>\u0411\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u043e\u0438. \u041c\u043e\u044f \u0446\u0435\u043b\u044c &#8212; \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u043e\u0439 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0432 Redux, \u0430 \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0449\u0435.<\/p>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u0435\u043b. <br \/>\u041a\u043e\u0434 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. \u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/github.com\/sergeysibara\/mobx-react-4-layer-architecture\" rel=\"noopener noreferrer nofollow\">github<\/a> \u0438 \u0432 <a href=\"https:\/\/codesandbox.io\/s\/mobx-react-4-layer-architecture-cko6u\" rel=\"noopener noreferrer nofollow\">codesanbox<\/a>. <br \/>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043f\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 &#8212; <a href=\"https:\/\/softwareengineering.stackexchange.com\/a\/338610\" rel=\"noopener noreferrer nofollow\">Folder-by-<strong>feature<\/strong><\/a>. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043e\u0431\u0449\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0432\u0440\u043e\u0434\u0435 ducks\/stores, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u0440\u0435\u0434\u044c\u044e\u0441\u0435\u0440\u044b\/actions\/stores, \u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043f\u043e\u043a \u0443 \u0432\u0430\u0441 \u0432\u0440\u044f\u0434 \u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0432\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435. \u0421\u0443\u0442\u044c \u0442\u0430\u043a\u0430\u044f, \u0447\u0442\u043e \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 feature\/\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0440\u044f\u0434\u043e\u043c \u0441 \u043d\u0435\u0439, \u0430 \u043d\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p><strong>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"#store-layer\" rel=\"noopener noreferrer nofollow\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u043e\u044f \u0441\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 MobX<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#api\" rel=\"noopener noreferrer nofollow\"><strong>\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 (API \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b)<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#controller\" rel=\"noopener noreferrer nofollow\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u043e\u044f controller (\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 middleware \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435)<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#initialization\" rel=\"noopener noreferrer nofollow\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u043e\u0440\u043e\u0432, api \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#component\" rel=\"noopener noreferrer nofollow\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u0430 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#conclusion\" rel=\"noopener noreferrer nofollow\"><strong>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0421\u0445\u0435\u043c\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b<\/strong><\/a><\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"store-layer\" id=\"store-layer\"><\/a><\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u043e\u044f \u0441\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 MobX<\/h2>\n<p>\u041a\u0430\u043a \u0438 \u0432 Redux, \u044d\u0442\u043e\u0442 \u0441\u043b\u043e\u0439 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u043e\u0435\u0432.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u043e\u0440\u043e\u0432 &#8212; \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c, \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u043e\u0440\u043c\u043e\u0439, \u0442\u0440\u0435\u0442\u0438\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 (\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430, \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044f). \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0430. \u041d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0442\u044c \u0441\u0442\u043e\u0440 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 feature \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u0430. \u0411\u0435\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0431\u044b \u0442\u0430\u043a: &#171;BaseStore&lt;TListItem, TEditItem, TSearchParams&gt;&#187;, \u0447\u0442\u043e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u0442 \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0414\u043b\u044f \u0441\u0442\u043e\u0440\u043e\u0432 \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 (API, middleware) \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b. \u041d\u0430 github \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 todos (\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b\/feature) \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0442 \u043a\u043e\u0434\u0430 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 api.js, controllers.js, stores.js, \u0442.\u043a. \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u0432 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b, \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0412 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0438\u0445, \u0442.\u043a. \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442\u044c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b, \u0430 \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041a\u043b\u0430\u0441\u0441\u044b \u0437\u0434\u0435\u0441\u044c \u0443\u0434\u043e\u0431\u043d\u044b \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0437\u0430\u0434\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043e\u0431\u0449\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u043c\u0435\u043d\u0435\u0435 \u0432\u0430\u0436\u043d\u043e, \u043a\u0430\u043a \u0441\u043b\u043e\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438. \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u0441\u043b\u043e\u0438 API, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432  (\u043e \u043d\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043f\u043e\u0437\u0436\u0435), \u0441\u0442\u043e\u0440\u043e\u0432 \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u044b \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0442\u043e\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">\/\/ \u041e\u0431\u0449\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \/\/ src\/core\/types\/index.ts export type ObjectType = Record&lt;string, unknown&gt; | null | undefined; export type ErrorType = string | ObjectType; export interface IIdentifiable { id: number; }<\/code><\/pre>\n<pre><code class=\"javascript\">\/\/ \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0441\u0442\u043e\u0440\u043e\u0432, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \/\/ src\/core\/store\/BaseListStore.ts import { observable, action, computed, makeObservable } from 'mobx'; import { ErrorType, ObjectType, IIdentifiable } from 'core\/types';  export interface IListState&lt;TListItem extends IIdentifiable&gt; {   results: TListItem[];   count?: number; \/\/ \u0447\u0438\u0441\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043f\u044d\u0439\u0434\u0436\u0438\u043d\u0433\u0430.   isLoading?: boolean;   error?: ErrorType; }  export default class BaseListStore&lt;TListItem extends IIdentifiable&gt; {   @observable   protected listState: IListState&lt;TListItem&gt; = {     results: [],   };    constructor() {     makeObservable&lt;BaseListStore&lt;TListItem&gt;&gt;(this);   }    @computed   get list(): TListItem[] {     return Array.isArray(this.listState.results)         ? this.listState.results         : [];   }    @action   setListState(list: IListState&lt;TListItem&gt;) {     this.listState = list;   }    @action   addToList(item: TListItem) {     this.list.push(item);   }    @action   updateListItem(item: TListItem) {     const foundTodo = this.list.find((i) =&gt; item &amp;&amp; i.id === item.id);     if (foundTodo &amp;&amp; item) {       Object.assign(foundTodo, item);     }   }   ... }  \/\/ \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0438\u043f \u0441\u0442\u043e\u0440\u0430 export type BaseListStoreType = BaseListStore&lt;IIdentifiable&gt;;<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 Todo. \u041f\u043e\u043a\u0430-\u0447\u0442\u043e \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0441\u043f\u0438\u0441\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c BaseListStire&lt;T&gt;.<\/p>\n<pre><code class=\"javascript\">\/\/ src\/pages\/todos\/stores.tsx import { IIdentifiable } from 'core\/types';  export interface ITodoModel extends IIdentifiable {   title: string;   completed: boolean; }  export type TodoListStoreType = BaseListStore&lt;ITodoModel&gt;;<\/code><\/pre>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"api\" id=\"api\"><\/a><\/p>\n<h2>\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 (API \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b)<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u043d\u0435 \u0437\u0430\u0441\u043e\u0440\u044f\u0442\u044c \u043a\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 axios. \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u043e\u044f\u0445. \u041e\u043d \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0442\u043e\u0440 \u0438\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e. \u0412 Redux \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043f\u0440\u043e \u044d\u0442\u043e\u0439 \u0441\u043b\u043e\u0439, \u043d\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u0435\u0433\u043e, \u043a\u0430\u043a \u0438 \u044f.<\/p>\n<p>\u0412 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f axios \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441. \u0422.\u043a. \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u043f\u043e\u043b\u044c\u0437\u044b \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0432\u0438\u0434\u043d\u043e. \u041d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u044d\u0442\u043e \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438\u043b\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0438\u043b\u0438 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438. <\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e api \u0441\u0435\u0440\u0432\u0438\u0441\u044b. \u041d\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b. <\/p>\n<details class=\"spoiler\">\n<summary>core\/api\/apiService.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; import { ObjectType } from '..\/types';  axios.defaults.baseURL = process.env.REACT_APP_BASE_API_URL;  export type ApiServiceResponseType = Promise&lt;AxiosResponse&lt;any&gt;&gt;;  const apiService = {   get: function (     url: string,     config?: AxiosRequestConfig,   ): ApiServiceResponseType {     return axios.get(url, config);   },    post: function (     url: string,     data: ObjectType,     config?: AxiosRequestConfig,   ): ApiServiceResponseType {     return axios.post(url, data, config);   },    patch: function (     url: string,     data: ObjectType,     config?: AxiosRequestConfig,   ): ApiServiceResponseType {     return axios.patch(url, data, config);   },    delete: function (     url: string,     config?: AxiosRequestConfig,   ): ApiServiceResponseType {     return axios.delete(url, config);   }, };  export default apiService;<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 apiService. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0442\u043e\u0436\u0435 \u0447\u0430\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f.<\/p>\n<details class=\"spoiler\">\n<summary>core\/api\/BaseApi.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">import apiService from '.\/apiService'; import { IResponseList, IResponseModel, IResponseError } from '.\/types'; import { IIdentifiable, ObjectType } from '..\/types';  export default class BaseApi&lt;T extends IIdentifiable&gt; {   private readonly _apiUrl: string;    get apiUrl(): string {     return this._apiUrl;   }    constructor(apiUrl: string) {     this._apiUrl = apiUrl;   }    async getList(     params?: ObjectType,   ): Promise&lt;IResponseList&lt;T&gt; | IResponseError&gt; {     try {       const ret = await apiService.get(this._apiUrl, { params });       return { results: ret.data || [] };     } catch (error) {       return this.handleError(error);     }   }    async update(     modelData: { id: number },     params?: ObjectType,   ): Promise&lt;IResponseModel&lt;T&gt; | IResponseError&gt; {     try {       const ret = await apiService.patch(         `${this._apiUrl}\/${modelData.id}`,         modelData,         { params },       );       return { model: ret.data };     } catch (error) {       return this.handleError(error);     }   }    protected handleError(e): IResponseError {     let message = '';     if (e.response) {       message = e.message;     }      return { isError: true, message };   } }  export type BaseApiType = BaseApi&lt;IIdentifiable&gt;;<\/code><\/pre>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"controller\" id=\"controller\"><\/a><\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u043e\u044f controller (\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 Redux middleware \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435)<\/h2>\n<p><strong>\u0412 \u0441\u0432\u043e\u0435\u043c \u043a\u043e\u0434\u0435 \u0432\u043c\u0435\u0441\u0442\u043e middleware \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d \u0438\u0437 MVC &#8212; Controller.<\/strong> \u0412 Redux \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c middlewares \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0438. \u0422.\u043a. \u044d\u0442\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e, \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0438 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b \u0443 \u0441\u0435\u0431\u044f \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0438. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0435 \u041f\u041e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u043b\u0438 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 API \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440. \u0422\u0430\u043a \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u0432\u043e\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0432\u043f\u0435\u0440\u0435\u043c\u0435\u0448\u043a\u0443.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 &#8212; \u0431\u044b\u0442\u044c \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a\u043e\u043c \u043c\u0435\u0436\u0434\u0443 api, \u0441\u0442\u043e\u0440\u043e\u043c \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c. \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c api \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043b\u043e\u0433\u0438\u043a\u0443, \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430, \u043a\u0430\u043a\u043e\u0439 api \u043c\u0435\u0442\u043e\u0434 \u0438 \u0441\u0442\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440. \u041e\u0431\u0449\u0443\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 api. \u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0441\u0442\u043e\u0438\u0442 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f \u043a \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u043e\u0435 View (\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b) \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445.  \u042d\u0442\u043e\u0442 \u0441\u043b\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c \u043e\u0442 \u0441\u043b\u043e\u044f \u0441\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u043b\u043e\u044f API.<\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u0449\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u0430 \u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u043c\u0438 CRUD \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>src\/core\/controllers\/BaseController.ts<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">import <\/code><\/pre>\n<\/div>\n<\/details>\n<p><\/br><\/p>\n<\/div>\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-319584","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/319584","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=319584"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/319584\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=319584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=319584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}