{"id":311228,"date":"2020-10-09T15:00:55","date_gmt":"2020-10-09T15:00:55","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=311228"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=311228","title":{"rendered":"\u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 MobX, \u0430 \u043d\u0435 Redux, \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/522312\/\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c84\/4b7\/a1a\/c844b7a1a76d753381cc028b0ff117eb.jpg\" alt=\"Choices and consequences .. BY  Ash-3xpired. \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a https:\/\/www.deviantart.com\/ash-3xpired\/art\/Choices-and-consequences-198140687\" title=\"Choices and consequences .. BY  Ash-3xpired. \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a https:\/\/www.deviantart.com\/ash-3xpired\/art\/Choices-and-consequences-198140687\" width=\"587\" height=\"292\"><figcaption>Choices and consequences .. BY  Ash-3xpired. \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a https:\/\/www.deviantart.com\/ash-3xpired\/art\/Choices-and-consequences-198140687<\/figcaption><\/figure>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041d\u0430\u0437\u0438\u043c \u0413\u0430\u0444\u0430\u0440\u043e\u0432, \u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0432 <a href=\"https:\/\/mcs.mail.ru\/\"><u>Mail.ru Cloud Solutions<\/u><\/a>. \u041d\u0430 \u0434\u0432\u043e\u0440\u0435 2020 \u0433\u043e\u0434, \u0430 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u00ab\u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f\u00bb ES6-\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 MobX \u043d\u0430\u0434 Redux. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0447\u0438\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Redux \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u044f \u043d\u0435 \u0437\u043d\u0430\u044e \u043d\u0438 \u043e\u0434\u043d\u043e\u0439, \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 MobX.<\/p>\n<h3>\u041a\u0430\u043a \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e MobX<\/h3>\n<p>Mail.ru Cloud Solutions \u2014 \u044d\u0442\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u0443 \u043d\u0430\u0441 \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f React-\u0430\u0434\u043c\u0438\u043d\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u043e\u0439: \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b, \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u044b Kubernetes. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442\u044b \u043f\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0443, \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u043f\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0438 \u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435.&nbsp;<\/p>\n<p>\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0442\u0435\u043a \u2014 TypeScript, React, Redux, Formik \u2014 \u043d\u0430\u0441 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c Redux. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043a \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u0438 \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u2014 \u0430\u0434\u043c\u0438\u043d\u043a\u0443 \u0434\u043b\u044f <a href=\"https:\/\/mcs.mail.ru\/iot\/\"><u>\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0432\u0435\u0449\u0435\u0439<\/u><\/a>. \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u2014 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0434\u043e\u043c\u0435\u043d\u0435 \u0438 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u043e\u043c, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 MobX.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 Redux<\/h3>\n<h4>\u041c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0432\u0441\u0435\u043c \u043d\u0430\u0434\u043e\u0435\u043b\u0438 \u0437\u0430\u0432\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u044c Redux, \u043d\u043e \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/codesandbox.io\/s\/vjynjwo777\"><u>\u043a\u043e\u0434 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430<\/u><\/a>. \u0418\u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u044d\u043a\u0448\u0435\u043d\u044b:<\/p>\n<pre><code class=\"javascript\">export function increment() {   return {     type: 'INCREMENT'   } }  export function decrement() {   return {     type: 'DECREMENT'   } }<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u043b\u043e, \u0441\u043e\u0437\u0434\u0430\u044e\u0442 actionTypes:<\/p>\n<pre><code class=\"javascript\">export const INCREMENT = 'INCREMENT' export const DECREMENT = 'DECREMENT'<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u0438\u0448\u0435\u043c \u0440\u0435\u0434\u044c\u044e\u0441\u0435\u0440\u044b:<\/p>\n<pre><code class=\"javascript\">export default (state = { count: 0 }, action) =&gt; {   switch (action.type) {     case 'INCREMENT':       return {         count: state.count + 1       }     case 'DECREMENT':       return {         count: state.count - 1       }     default:       return state   } }<\/code><\/pre>\n<p>\u041c\u0430\u043f\u0438\u043c State \u0438 Dispatch \u2014 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0437\u0430\u0447\u0435\u043c, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0438 \u043d\u0435\u0442:<\/p>\n<pre><code class=\"javascript\">const mapStateToProps = (state) =&gt; {   return {     count: state.count   } }  const mapDispatchToProps = (dispatch) =&gt; {   return {     onIncrement: () =&gt; {       dispatch(increment())     },     onDecrement: () =&gt; {       dispatch(decrement())     }   } }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0437\u0430\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442:<\/p>\n<pre><code class=\"javascript\">import { connect } from 'react-redux'  export default connect(   mapStateToProps,   mapDispatchToProps )(Counter)<\/code><\/pre>\n<p>\u0410, \u043d\u0435\u0442, \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435. \u0415\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c Store:<\/p>\n<pre><code class=\"javascript\">import { createStore } from 'redux' import reducers from '.\/reducer'  const store = createStore(reducers)  export default store<\/code><\/pre>\n<p>\u0418 \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c \u043d\u0430\u0448 Store \u0434\u0430\u043b\u044c\u0448\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 Provider:<\/p>\n<pre><code class=\"javascript\">import store from '.\/store' import Page from '.\/Page'  const App = () =&gt; (   &lt;Provider store={store}&gt;     &lt;Page \/&gt;   &lt;\/Provider&gt; )<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u043e \u043d\u0430 MobX. \u0412\u0435\u0440\u0441\u0442\u043a\u0430:<\/p>\n<pre><code class=\"javascript\">import { observer } from \"mobx-react\" import CounterStore from \".\/Counter\"  const App = observer(props =&gt; {   const { count, increase, decrease } = CounterStore    return (     &lt;div&gt;       &lt;h1&gt;{count}&lt;\/h1&gt;       &lt;button onClick={increase}&gt;increment&lt;\/button&gt;       &lt;button onClick={decrease}&gt;decrement&lt;\/button&gt;     &lt;\/div&gt;   ) })<\/code><\/pre>\n<p>Store:<\/p>\n<pre><code class=\"javascript\">import { observable, action } from \"mobx\"  class Counter {   @observable count = 0    @action decrease = () =&gt; {     this.count = this.count - 1   }    @action increase = () =&gt; {     this.count = this.count + 1   } }  const CounterStore = new Counter() export default CounterStore<\/code><\/pre>\n<p>\u042f \u043c\u043e\u0433\u0443 \u043f\u043e\u043d\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u044c \u0432 \u043e\u0431\u043c\u0435\u043d \u043d\u0430 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438 \u0432 \u043e\u0431\u043c\u0435\u043d \u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u044c \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u043e \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0434\u0438 \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u0438&#8230; \u0417\u0430\u0447\u0435\u043c? \u0414\u043b\u044f \u0447\u0435\u0433\u043e?<\/p>\n<p>\u0425\u043e\u0442\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/react-redux.js.org\/api\/hooks\">\u0445\u0443\u043a\u0430\u043c\u0438<\/a>, \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0439 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043a\u043e\u0434, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c 100500 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u044d\u0442\u0438\u043c \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>underscopeio\/reduxable<\/p>\n<\/li>\n<li>\n<p>jkeam\/reduxsauce<\/p>\n<\/li>\n<li>\n<p>jamesplease\/zero-boilerplate-redux<\/p>\n<\/li>\n<li>\n<p>redux-zero\/redux-zero<\/p>\n<\/li>\n<li>\n<p>MynockSpit\/no-boilerplate-redux<\/p>\n<\/li>\n<\/ul>\n<p>\u0423 \u043d\u0430\u0441 \u0442\u043e\u0436\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430, \u043e\u043d\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Redux-helper. \u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0432\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0431\u044f \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u043d\u0430\u0434 Redux \u0434\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u043e\u043c. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0442\u0430\u043a \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c Redux, \u0442\u043e \u0443 \u0432\u0430\u0441 <a href=\"https:\/\/www.youtube.com\/watch?v=N83TGqyL4-g\"><u>\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f MobX<\/u><\/a>.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u044b\u0431\u043e\u0440\u0430<\/h3>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u043e\u043c \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 MobX:<\/p>\n<pre><code class=\"javascript\">class PostsStore {   @observable isLoading = false   @observable posts = []    @action getPosts = async () =&gt; {     this.isLoading = true     this.posts = await api.getPosts()     this.isLoading = false   } }<\/code><\/pre>\n<p>\u0412\u0435\u0440\u0441\u0442\u043a\u0430:<\/p>\n<pre><code class=\"javascript\">import PostStore from 'PostStore'  const PostsPage = observer(() =&gt; {   const { posts, isLoading } = PostStore    if (isLoading) {     return &lt;div&gt;\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0441\u0442\u043e\u0432&lt;\/div&gt;   }    return (     &lt;ul&gt;       { posts.map(post =&gt; &lt;li&gt;{post.title}&lt;\/li&gt;) }     &lt;\/ul&gt;   ) })<\/code><\/pre>\n<p>\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0430 Redux \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u0436\u0435 \u0437\u0430 300 \u0431\u0430\u043a\u0441\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0437\u0430\u0439\u043c\u0435\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438 \u0432 Redux \u2014 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0412 \u043c\u043e\u0435\u043c \u0434\u0435\u0442\u0441\u0442\u0432\u0435 \u0442\u0435\u0431\u044f \u043c\u043e\u0433\u043b\u0438 \u0438\u0437\u0431\u0438\u0442\u044c \u0438 \u0437\u0430 \u043c\u0435\u043d\u044c\u0448\u0443\u044e \u043e\u043f\u043b\u043e\u0448\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438 (\u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u043b \u0435\u0435 \u0432 \u0432\u0435\u0431\u0435), \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u043e redux-thunk, redux-saga, redux-observable \u0438 redux-loop.&nbsp;<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043b\u044e\u0431\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 Redux \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<ul>\n<li>\n<p>\u041d\u0443\u0436\u043d\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u0434\u043e\u0431\u0430\u0432\u044c redux-thunk.<\/p>\n<\/li>\n<li>\n<p>\u0425\u043e\u0447\u0435\u0448\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430 \u2014 \u0432\u043e\u0437\u044c\u043c\u0438 redux-zero.<\/p>\n<\/li>\n<li>\n<p>Reselect \u0434\u043b\u044f \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>Normalizr \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0449\u0435 \u043d\u0443\u0436\u0435\u043d Immutable.js, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043f\u0440\u0435\u0434\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0443 \u0438 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <a href=\"https:\/\/github.com\/reduxjs\/redux-toolkit#whats-included\"><u>\u0434\u043e\u0431\u0430\u0432\u0438\u043c<\/u><\/a> immer (\u043e\u0442 \u0430\u0432\u0442\u043e\u0440\u0430 MobX!)<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e. \u0412 React-\u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u0442\u0430\u043a \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0444\u043e\u0440\u043c, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u0442\u044c \u0438 \u043a\u0443\u0447\u0443 \u0432\u0441\u0435\u0433\u043e \u0435\u0449\u0435. Redux \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0443\u0433\u0443\u0431\u043b\u044f\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043e\u043d \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d, \u043a \u043d\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0435\u0449\u0435 \u0447\u0442\u043e-\u0442\u043e.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Redux \u2014 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0447\u0443\u0436\u0438\u0445 \u0441\u043f\u043e\u0440\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441 \u043c\u043e\u0434\u043d\u044b\u043c\u0438 \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u00ab\u0424\u0440\u0430\u043d\u043a\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u00bb, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0430\u043c, \u0430 \u043d\u0435 \u0442\u043e\u043c\u0443, \u043a\u0442\u043e \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043b.<\/p>\n<h4>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/h4>\n<p>\u0410\u0437\u0430\u0442 \u0420\u0435\u0437\u0435\u043d\u0442\u0438\u043d\u043e\u0432 \u0432 \u0441\u0432\u043e\u0435\u043c <a href=\"https:\/\/www.youtube.com\/watch?v=9rZeCNLfeuk\"><u>\u0434\u043e\u043a\u043b\u0430\u0434\u0435<\/u><\/a> \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b, \u043a\u0430\u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f MobX. \u0410 \u0432\u043e\u0442 \u0435\u0449\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/459706\/#comment_20382122\"><u>\u043e\u0434\u0438\u043d \u043e\u0442\u0437\u044b\u0432<\/u><\/a>, \u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0440 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430\u0441\u044c \u0432 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430.<\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0435 \u043c\u043d\u0435\u043d\u0438\u044f. \u0422\u044b\u0441\u044f\u0447\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0430 Stateofjs.com <a href=\"https:\/\/2018.stateofjs.com\/data-layer\/redux\/\"><u>\u043f\u0438\u0448\u0443\u0442<\/u><\/a>, \u0447\u0442\u043e \u0440\u0430\u0437\u0434\u0443\u0442\u043e\u0441\u0442\u044c (Bloated) \u0438 \u043a\u043e\u0440\u044f\u0432\u043e\u0441\u0442\u044c \u0441\u0442\u0438\u043b\u044f (Clumsy) \u2014 \u043e\u0434\u043d\u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u0432 Redux. \u0420\u0430\u0437\u0434\u0443\u0442\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u043b\u044c\u0448\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0420\u0430\u0437\u0434\u0443\u0442\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u2014 \u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u0438\u0447\u0438\u043d, \u043f\u043e\u0447\u0435\u043c\u0443 \u0438\u043d\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u044f\u043d\u0435 \u0435\u0449\u0435 \u043d\u0435 \u0432\u044b\u0448\u043b\u0438 \u0441 \u043d\u0430\u043c\u0438 \u043d\u0430 \u0441\u0432\u044f\u0437\u044c.<\/p>\n<h4>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b MobX \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u043d\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c, \u2014 \u0432\u043c\u0435\u0441\u0442\u043e O(n) \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Redux.<\/p>\n<p><iframe id=\"5f7c90dd9e27cdc93030ef8a\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/5f7c90dd9e27cdc93030ef8a\" class=\"embed_video embed__content\"><\/iframe><\/p>\n<p>\u0422\u043e\u0440\u043c\u043e\u0437\u043d\u0443\u0442\u043e\u0441\u0442\u044c Redux \u0432\u0448\u0438\u0442\u0430 \u0432 \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0443. \u0412 JavaScript \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u0440\u043e\u0433\u0430\u044f \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435. \u0414\u0430\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u043f\u043e \u0432\u0441\u0435\u043c \u0440\u0435\u0434\u044c\u044e\u0441\u0435\u0440\u0430\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \u2014 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u0440\u043e\u0433\u043e, \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0440\u043e\u0436\u0435, \u0447\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435.<\/p>\n<p>\u0412 MobX \u0432\u044b \u043d\u0435 \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0430 \u0443 \u0432\u0430\u0441 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<h4>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 useContext<\/h4>\n<p>\u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e useContext \u043d\u0435 \u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u0432\u0430\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043c\u0430\u0437\u0430\u0442\u044c\u0441\u044f useMemo \u0438 useCallback.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/codesandbox.io\/s\/summer-shadow-z703e\"><u>\u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/u><\/a> \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f @MaZaAa \u2014 alert() \u0432\u044b\u0441\u043a\u043e\u0447\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0435.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a MobX \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 shouldComponentUpdate, \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430 \u044d\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u2014 \u043f\u0435\u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e, \u0430 \u043d\u0435 \u0432\u0441\u0451 \u0434\u0435\u0440\u0435\u0432\u043e.<\/p>\n<h3>\u041d\u0435\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u043c\u0438\u043d\u0443\u0441\u044b MobX<\/h3>\n<p>1. \u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u044b \u0435\u0449\u0435 <a href=\"https:\/\/github.com\/tc39\/proposal-decorators\">\u043d\u0435 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435<\/a>, \u043d\u043e, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c <a href=\"https:\/\/mobx.js.org\/enabling-decorators.html\">\u0431\u0435\u0437 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u043e\u0432<\/a>, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/www.typescriptlang.org\/docs\/handbook\/decorators.html\">TypeScript<\/a>.<\/p>\n<p>2. \u041f\u044f\u0442\u044b\u0439 MobX \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 IE11, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 ES6 Proxy, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0438\u0444\u0438\u043b\u0438\u0442\u044c. \u0414\u043b\u044f \u043d\u0430\u0441 \u044d\u0442\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0441\u0435\u043c\u0438\u043b\u0435\u0442\u043d\u0435\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0433\u043e \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0435 (\u0445\u043e\u0442\u044f \u0443\u0436\u0435 <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/microsoft-365-blog\/microsoft-365-apps-say-farewell-to-internet-explorer-11-and\/ba-p\/1591666\"><u>\u0441\u0430\u043c Microsoft<\/u><\/a> \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c), \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c MobX 4 \u0432\u0435\u0440\u0441\u0438\u0438 (UPD: \u0438\u043b\u0438 <a href=\"https:\/\/michel.codes\/blogs\/mobx6\"><u>MobX 6<\/u><\/a>).<\/p>\n<p>3. Redux \u0432 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u043e\u0434\u043a\u0443\u043f\u0438\u043b \u0441\u0432\u043e\u0438\u043c\u0438 \u0434\u0435\u0432-\u0442\u0443\u043b\u0437\u0430\u043c\u0438. \u0412 MobX \u0441 \u044d\u0442\u0438\u043c \u0442\u043e\u0436\u0435 \u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/mobxjs\/mobx-devtools\"><u>mobx-devtools<\/u><\/a> \u0438\u043b\u0438 mobx-remotedev.<\/p>\n<p>4. \u0414\u043b\u044f Server-side \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442 \u0441\u0442\u0435\u0439\u0442, \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0435\u0433\u043e \u0432 JSON \u0438 \u043a\u043b\u0430\u0434\u0443\u0442 \u0432 window.__PRELOADED_STATE__. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, MobX \u043d\u0438\u043a\u0430\u043a \u0432\u0430\u0441 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u0441\u0442\u0435\u0439\u0442. \u0422\u0430\u043c \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 JSON.<\/p>\n<p>\u041d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 \u0441\u0442\u0435\u0439\u0442\u0435, \u0442\u043e SSR \u0441 MobX \u2014 \u0434\u0430\u0432\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/medium.com\/@borisdedejski\/next-js-mobx-and-typescript-boilerplate-for-beginners-9e28ac190f7d\"><u>\u0432 \u0442\u043e\u043c \u0436\u0435 Nextjs<\/u><\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e useStaticRendering.<\/p>\n<p>5. \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043c\u0430\u0433\u0438\u0438. \u041c\u043d\u0435 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u0435\u043d \u044d\u0442\u043e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u044b\u0448\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 MobX \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043c\u0430\u0433\u0438\u0438. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f, \u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u043d\u0430 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A2%D1%80%D0%B8_%D0%B7%D0%B0%D0%BA%D0%BE%D0%BD%D0%B0_%D0%9A%D0%BB%D0%B0%D1%80%D0%BA%D0%B0\"><u>\u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043c\u0430\u0433\u0438\u0435\u0439<\/u><\/a>. MobX \u2014 \u044d\u0442\u043e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A0%D0%B5%D0%B0%D0%BA%D1%82%D0%B8%D0%B2%D0%BD%D0%BE%D0%B5_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\"><u>\u043f\u0440\u043e\u0441\u0442\u043e FRP<\/u><\/a>, \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b. MobX \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0437\u0430 \u0432\u0430\u0441 \u0438 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e. \u041e\u043d \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442, \u043a \u043a\u0430\u043a\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0432\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0435\u0441\u044c, \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0438\u0445 \u0438 \u0442\u0430\u043a \u0441\u0442\u0440\u043e\u0438\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0439 \u0433\u0440\u0430\u0444.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 MobX \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/www.youtube.com\/watch?v=60atB_8FKkM\">\u0437\u0430 \u043f\u043e\u043b\u0447\u0430\u0441\u0430<\/a>.<\/p>\n<h3>\u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u043c\u0438\u043d\u0443\u0441\u044b MobX \u0438 \u043a\u0430\u043a \u0441 \u043d\u0438\u043c\u0438 \u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f<\/h3>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u043d\u0443\u0441 MobX \u2014 \u043e\u043d \u0434\u0430\u0435\u0442 \u0432\u0430\u043c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u044b \u0432 \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434, \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u0431\u043e\u0440\u043e\u043b\u0438\u0441\u044c \u0441 \u0438\u0437\u043b\u0438\u0448\u043d\u0435\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u043e\u0439.<\/p>\n<h4>\u041d\u0435 \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438<\/h4>\n<p>\u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0441\u043e \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u043e\u043c:<\/p>\n<pre><code class=\"xml\">&lt;h1&gt;{Store.count}&lt;\/h1&gt;  &lt;button onClick={Store.increase}&gt;   increment &lt;\/button&gt;<\/code><\/pre>\n<p>\u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u043e\u0442 \u0442\u0430\u043a, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u044c\u044e\u0445\u0435:<\/p>\n<pre><code class=\"xml\">&lt;button onClick={() =&gt; Store.count++}&gt;   increment &lt;\/button&gt;<\/code><\/pre>\n<p>\u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u043a \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0449\u0435 \u043d\u0430\u0448\u0438 \u0434\u0435\u0434\u044b \u0443\u0447\u0438\u043b\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 MVC.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/mobx.js.org\/refguide\/api.html#enforceactions\"><u>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043b\u0430\u0433 <\/u><\/a>enforceActions \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 MobX. \u041d\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0442\u044c \u0432\u0430\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c <a href=\"https:\/\/mobx.js.org\/actions.html\"><u>\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 Promise<\/u><\/a>.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 <a href=\"https:\/\/www.typescriptlang.org\/docs\/handbook\/classes.html#understanding-typescripts-private\"><u>\u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u0430\u043a private<\/u><\/a>. \u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0433\u0435\u0442\u0442\u0435\u0440.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u044d\u043a\u0448\u0435\u043d\u044b \u0438 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u044d\u0442\u0438\u043c \u0432 \u043a\u043e\u0434-\u0440\u0435\u0432\u044c\u044e.<\/p>\n<h4>\u041d\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440 \u043e\u0442 \u0441\u0442\u043e\u0440\u0430<\/h4>\n<p>MobX \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u043f\u043e\u043b\u044f \u043e\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0430. \u041e\u0434\u043d\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0442\u0440\u0435\u0442\u044c\u0435\u0439. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0439 \u043a\u0430\u0448\u0438, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440 \u043e\u0442 \u0441\u0442\u043e\u0440\u0430.<\/p>\n<p>\u0412 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 MVC-\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0438 \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0435\u0442 view \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0443 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438, \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439.<\/p>\n<p>\u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0443\u0442\u0438. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c, \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u0442\u0440\u0435\u0442\u0438\u0439 \u0441\u0442\u043e\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0434\u0432\u0443\u0445 \u0434\u0440\u0443\u0433\u0438\u0445. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u044d\u0442\u043e \u043d\u043e\u0432\u044b\u0439 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u044e\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u0434\u0430\u044e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u0422\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Ember \u0438 Angular, \u043d\u043e \u043a \u043d\u0438\u043c \u043c\u044b \u0435\u0449\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f.<\/p>\n<h4>\u041d\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430<\/h4>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f MobX \u0443\u0447\u0438\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">@inject(\"CounterStore\") @observer class App extends Component {     render() {         return (           &lt;h1&gt;{this.props.count}&lt;\/h1&gt;         )     } }<\/code><\/pre>\n<p>\u041c\u044b \u0436\u0435 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0438\u043c\u043f\u043e\u0440\u0442\u044b:<\/p>\n<pre><code class=\"javascript\">import CounterStore from \".\/Counter\"  const App = observer(() =&gt; {   return &lt;h1&gt;{CounterStore.count}&lt;\/h1&gt; })<\/code><\/pre>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c Store \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0441\u0435 \u0431\u043e\u043d\u0443\u0441\u044b \u043e\u0442 IDE, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043a\u043e\u043c\u043f\u043b\u0438\u0442 \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0442\u0430\u0439\u043f\u0447\u0435\u043a\u0438\u043d\u0433.<\/p>\n<p>\u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0435\u0441\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/post\/471048\/#comment_20751456\"><u>\u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u0442\u0440\u0435\u0434<\/u><\/a> \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443, \u0442\u0430\u043c \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043a\u043e\u0432 \u0438 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u043e\u0432 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 Vue\/Angular\/Ember<\/h3>\n<p>\u0423 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u044b\u043b \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u043f\u044b\u0442 \u0441 React, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0435 \u043c\u0435\u043d\u044f\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a. \u041d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u2014 \u0441\u0432\u044f\u0437\u043a\u0430 React+MobX \u0441 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u043c\u0438 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0442\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Vue.js.<\/p>\n<p>\u0421 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043d\u0430\u043b\u043e\u0436\u0438\u043b\u0438 \u043d\u0430 MobX, \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/angular.io\/start\/data\"><u>\u0441\u0442\u0430\u043b\u0430 \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 Angular<\/u><\/a>. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"java\">export class CartService {   items = [];    addToCart(product) {     this.items.push(product);   }    getItems() {     return this.items;   }    clearCart() {     this.items = [];     return this.items;   } }<\/code><\/pre>\n<p>\u0412 Ember <a href=\"https:\/\/guides.emberjs.com\/release\/services\/\"><u>\u0432\u0441\u0451 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435<\/u><\/a>, \u043e\u0434\u0438\u043d \u0432 \u043e\u0434\u0438\u043d:<\/p>\n<pre><code class=\"java\">import { A } from '@ember\/array'; import Service from '@ember\/service';  export default class ShoppingCartService extends Service {   items = A([]);    add(item) {     this.items.pushObject(item);   }    remove(item) {     this.items.removeObject(item);   }    empty() {     this.items.clear();   } }<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0435\u0441\u044c <s>\u0446\u0438\u0432\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439<\/s> \u044d\u043d\u0442\u0435\u0440\u043f\u0440\u0430\u0439\u0437-\u043c\u0438\u0440 \u0442\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0434\u043d\u043e\u0439 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u0412 \u044d\u0442\u043e\u043c \u0436\u0435 \u043c\u0435\u0441\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u0432\u0441\u0451 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e.<\/p>\n<p>Redux \u043a\u0438\u0447\u0438\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u043e\u0434\u0438\u043d \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043f\u0440\u0430\u0432\u0434\u044b, \u0445\u043e\u0442\u044f \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e <a href=\"https:\/\/twitter.com\/tjholowaychuk\/status\/957853652483416064\"><u>\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f<\/u><\/a>. \u0412 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0432\u0430\u043c, \u0441\u043a\u043e\u0440\u0435\u0435, \u043d\u0443\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u0432\u043e\u044e \u0434\u043e\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c, \u0447\u0435\u043c \u043a\u0443\u0447\u0430 \u0445\u043b\u0430\u043c\u0430 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/p>\n<p>\u041d\u0435 \u043d\u0430\u0434\u043e \u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0430\u0437\u0430\u0432 \u0447\u0443\u0434\u043e\u0432\u0438\u0449\u043d\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0441\u043e\u0432\u0441\u043a\u0438\u0439 \u043a\u043e\u0434 \u043f\u043e \u043f\u044f\u0442\u0438 \u0444\u0430\u0439\u043b\u0430\u043c, \u0432\u044b \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442\u0435 \u0435\u0433\u043e \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0440\u0435\u043c\u043e\u043d\u0442\u043e\u043f\u0440\u0438\u0433\u043e\u0434\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>\u041c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 MobX, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432 \u043a\u043b\u0430\u0441\u0441\u044b.<\/p>\n<p>\u0412 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f Redux \u043f\u043e\u0431\u0435\u0434\u0438\u043b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u044b\u043b \u0440\u0430\u0437\u0443\u043c\u043d\u043e\u0439 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439 \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u043c\u0443 jQuery. \u041d\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u0430\u0434\u0430\u0442\u044c \u0432\u0441\u044e \u0436\u0438\u0437\u043d\u044c, \u043f\u043e\u0440\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<hr>\n<p>P.S. \u042d\u0442\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u043e\u043a\u043b\u0430\u0434\u0430 \u0441 React Moscow \u0438 <a href=\"https:\/\/www.youtube.com\/watch?v=629ZhWebKzs\"><u>Panda Meetup #39<\/u><\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0435\u0449\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u043e \u0442\u0435\u043c\u0435:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/506752\/\"><u>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043b\u0435\u043d\u0438\u0432\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/mcs.mail.ru\/blog\/plyusy-svyazki-mobx-react-dlya-upravleniya-sostoyaniem-prilozheniya\"><u>\u041f\u043b\u044e\u0441\u044b \u0441\u0432\u044f\u0437\u043a\u0438 MobX + React \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/t.me\/zavtra_oblachno\"><u>\u041d\u0430\u0448 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u043a\u0430\u043d\u0430\u043b \u043e \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/u><\/a>.&nbsp;<\/p>\n<\/li>\n<\/ol>\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\/company\/mailru\/blog\/522312\/\"> https:\/\/habr.com\/ru\/company\/mailru\/blog\/522312\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/522312\/\">\n<figure class=\"full-width\"><figcaption>Choices and consequences .. BY  Ash-3xpired. \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a https:\/\/www.deviantart.com\/ash-3xpired\/art\/Choices-and-consequences-198140687<\/figcaption><\/figure>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041d\u0430\u0437\u0438\u043c \u0413\u0430\u0444\u0430\u0440\u043e\u0432, \u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0432 <a href=\"https:\/\/mcs.mail.ru\/\"><u>Mail.ru Cloud Solutions<\/u><\/a>. \u041d\u0430 \u0434\u0432\u043e\u0440\u0435 2020 \u0433\u043e\u0434, \u0430 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u00ab\u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f\u00bb ES6-\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 MobX \u043d\u0430\u0434 Redux. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0447\u0438\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Redux \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u044f \u043d\u0435 \u0437\u043d\u0430\u044e \u043d\u0438 \u043e\u0434\u043d\u043e\u0439, \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 MobX.<\/p>\n<h3>\u041a\u0430\u043a \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e MobX<\/h3>\n<p>Mail.ru Cloud Solutions \u2014 \u044d\u0442\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430, \u0443 \u043d\u0430\u0441 \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f React-\u0430\u0434\u043c\u0438\u043d\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u043e\u0439: \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b, \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u044b Kubernetes. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442\u044b \u043f\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0443, \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u043f\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0438 \u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435.&nbsp;<\/p>\n<p>\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u0442\u0435\u043a \u2014 TypeScript, React, Redux, Formik \u2014 \u043d\u0430\u0441 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c Redux. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043a \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u0438 \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u2014 \u0430\u0434\u043c\u0438\u043d\u043a\u0443 \u0434\u043b\u044f <a href=\"https:\/\/mcs.mail.ru\/iot\/\"><u>\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0432\u0435\u0449\u0435\u0439<\/u><\/a>. \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u2014 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0434\u043e\u043c\u0435\u043d\u0435 \u0438 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u043e\u043c, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 MobX.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 Redux<\/h3>\n<h4>\u041c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0432\u0441\u0435\u043c \u043d\u0430\u0434\u043e\u0435\u043b\u0438 \u0437\u0430\u0432\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u044c Redux, \u043d\u043e \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/codesandbox.io\/s\/vjynjwo777\"><u>\u043a\u043e\u0434 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430<\/u><\/a>. \u0418\u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u044d\u043a\u0448\u0435\u043d\u044b:<\/p>\n<pre><code class=\"javascript\">export function increment() {   return {     type: 'INCREMENT'   } }  export function decrement() {   return {     type: 'DECREMENT'   } }<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u043b\u043e, \u0441\u043e\u0437\u0434\u0430\u044e\u0442 actionTypes:<\/p>\n<pre><code class=\"javascript\">export const INCREMENT = 'INCREMENT' export const DECREMENT = 'DECREMENT'<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u0438\u0448\u0435\u043c \u0440\u0435\u0434\u044c\u044e\u0441\u0435\u0440\u044b:<\/p>\n<pre><code class=\"javascript\">export default (state = { count: 0 }, action) =&gt; {   switch (action.type) {     case 'INCREMENT':       return {         count: state.count + 1       }     case 'DECREMENT':       return {         count: state.count - 1       }     default:       return state   } }<\/code><\/pre>\n<p>\u041c\u0430\u043f\u0438\u043c State \u0438 Dispatch \u2014 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0437\u0430\u0447\u0435\u043c, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0438 \u043d\u0435\u0442:<\/p>\n<pre><code class=\"javascript\">const mapStateToProps = (state) =&gt; {   return {     count: state.count   } }  const mapDispatchToProps = (dispatch) =&gt; {   return {     onIncrement: () =&gt; {       dispatch(increment())     },     onDecrement: () =&gt; {       dispatch(decrement())     }   } }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0437\u0430\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442:<\/p>\n<pre><code class=\"javascript\">import { connect } from 'react-redux'  export default connect(   mapStateToProps,   mapDispatchToProps )(Counter)<\/code><\/pre>\n<p>\u0410, \u043d\u0435\u0442, \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435. \u0415\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c Store:<\/p>\n<pre><code class=\"javascript\">import { createStore } from 'redux' import reducers from '.\/reducer'  const store = createStore(reducers)  export default store<\/code><\/pre>\n<p>\u0418 \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c \u043d\u0430\u0448 Store \u0434\u0430\u043b\u044c\u0448\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 Provider:<\/p>\n<pre><code class=\"javascript\">import store from '.\/store' import Page from '.\/Page'  const App = () =&gt; (   &lt;Provider store={store}&gt;     &lt;Page \/&gt;   &lt;\/Provider&gt; )<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u043e \u043d\u0430 MobX. \u0412\u0435\u0440\u0441\u0442\u043a\u0430:<\/p>\n<pre><code class=\"javascript\">import { observer } from \"mobx-react\" import CounterStore from \".\/Counter\"  const App = observer(props =&gt; {   const { count, increase, decrease } = CounterStore    return (     &lt;div&gt;       &lt;h1&gt;{count}&lt;\/h1&gt;       &lt;button onClick={increase}&gt;increment&lt;\/button&gt;       &lt;button onClick={decrease}&gt;decrement&lt;\/button&gt;     &lt;\/div&gt;   ) })<\/code><\/pre>\n<p>Store:<\/p>\n<pre><code class=\"javascript\">import { observable, action } from \"mobx\"  class Counter {   @observable count = 0    @action decrease = () =&gt; {     this.count = this.count - 1   }    @action increase = () =&gt; {     this.count = this.count + 1   } }  const CounterStore = new Counter() export default CounterStore<\/code><\/pre>\n<p>\u042f \u043c\u043e\u0433\u0443 \u043f\u043e\u043d\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u044c \u0432 \u043e\u0431\u043c\u0435\u043d \u043d\u0430 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438 \u0432 \u043e\u0431\u043c\u0435\u043d \u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u044c \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u043e \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0434\u0438 \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u0438&#8230; \u0417\u0430\u0447\u0435\u043c? \u0414\u043b\u044f \u0447\u0435\u0433\u043e?<\/p>\n<p>\u0425\u043e\u0442\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/react-redux.js.org\/api\/hooks\">\u0445\u0443\u043a\u0430\u043c\u0438<\/a>, \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0439 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u043a\u043e\u0434, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c 100500 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u044d\u0442\u0438\u043c \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>underscopeio\/reduxable<\/p>\n<\/li>\n<li>\n<p>jkeam\/reduxsauce<\/p>\n<\/li>\n<li>\n<p>jamesplease\/zero-boilerplate-redux<\/p>\n<\/li>\n<li>\n<p>redux-zero\/redux-zero<\/p>\n<\/li>\n<li>\n<p>MynockSpit\/no-boilerplate-redux<\/p>\n<\/li>\n<\/ul>\n<p>\u0423 \u043d\u0430\u0441 \u0442\u043e\u0436\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430, \u043e\u043d\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Redux-helper. \u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0432\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0431\u044f \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u043d\u0430\u0434 Redux \u0434\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u043e\u043c. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0442\u0430\u043a \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c Redux, \u0442\u043e \u0443 \u0432\u0430\u0441 <a href=\"https:\/\/www.youtube.com\/watch?v=N83TGqyL4-g\"><u>\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f MobX<\/u><\/a>.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u044b\u0431\u043e\u0440\u0430<\/h3>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u043e\u043c \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 MobX:<\/p>\n<pre><code class=\"javascript\">class PostsStore {   @observable isLoading = false   @observable posts = []    @action getPosts = async () =&gt; {     this.isLoading = true     this.posts = await api.getPosts()     this.isLoading = false   } }<\/code><\/pre>\n<p>\u0412\u0435\u0440\u0441\u0442\u043a\u0430:<\/p>\n<pre><code class=\"javascript\">import PostStore from 'PostStore'  const PostsPage = observer(() =&gt; {   const { posts, isLoading } = PostStore    if (isLoading) {     return &lt;div&gt;\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0441\u0442\u043e\u0432&lt;\/div&gt;   }    return (     &lt;ul&gt;       { posts.map(post =&gt; &lt;li&gt;{post.title}&lt;\/li&gt;) }     &lt;\/ul&gt;   ) })<\/code><\/pre>\n<p>\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0430 Redux \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u0436\u0435 \u0437\u0430 300 \u0431\u0430\u043a\u0441\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0437\u0430\u0439\u043c\u0435\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438 \u0432 Redux \u2014 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0412 \u043c\u043e\u0435\u043c \u0434\u0435\u0442\u0441\u0442\u0432\u0435 \u0442\u0435\u0431\u044f \u043c\u043e\u0433\u043b\u0438 \u0438\u0437\u0431\u0438\u0442\u044c \u0438 \u0437\u0430 \u043c\u0435\u043d\u044c\u0448\u0443\u044e \u043e\u043f\u043b\u043e\u0448\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438 (\u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u043b \u0435\u0435 \u0432 \u0432\u0435\u0431\u0435), \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u043e redux-thunk, redux-saga, redux-observable \u0438 redux-loop.&nbsp;<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043b\u044e\u0431\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 Redux \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<ul>\n<li>\n<p>\u041d\u0443\u0436\u043d\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u0434\u043e\u0431\u0430\u0432\u044c redux-thunk.<\/p>\n<\/li>\n<li>\n<p>\u0425\u043e\u0447\u0435\u0448\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0431\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430 \u2014 \u0432\u043e\u0437\u044c\u043c\u0438 redux-zero.<\/p>\n<\/li>\n<li>\n<p>Reselect \u0434\u043b\u044f \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>Normalizr \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0449\u0435 \u043d\u0443\u0436\u0435\u043d Immutable.js, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043f\u0440\u0435\u0434\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0443 \u0438 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <a href=\"https:\/\/github.com\/reduxjs\/redux-toolkit#whats-included\"><u>\u0434\u043e\u0431\u0430\u0432\u0438\u043c<\/u><\/a> immer (\u043e\u0442 \u0430\u0432\u0442\u043e\u0440\u0430 MobX!)<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e. \u0412 React-\u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u0442\u0430\u043a \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0444\u043e\u0440\u043c, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u0442\u044c \u0438 \u043a\u0443\u0447\u0443 \u0432\u0441\u0435\u0433\u043e \u0435\u0449\u0435. Redux \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0443\u0433\u0443\u0431\u043b\u044f\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043e\u043d \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d, \u043a \u043d\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0435\u0449\u0435 \u0447\u0442\u043e-\u0442\u043e.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Redux \u2014 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0447\u0443\u0436\u0438\u0445 \u0441\u043f\u043e\u0440\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441 \u043c\u043e\u0434\u043d\u044b\u043c\u0438 \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u00ab\u0424\u0440\u0430\u043d\u043a\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u00bb, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0430\u043c, \u0430 \u043d\u0435 \u0442\u043e\u043c\u0443, \u043a\u0442\u043e \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043b.<\/p>\n<h4>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/h4>\n<p>\u0410\u0437\u0430\u0442 \u0420\u0435\u0437\u0435\u043d\u0442\u0438\u043d\u043e\u0432 \u0432 \u0441\u0432\u043e\u0435\u043c <a href=\"https:\/\/www.youtube.com\/watch?v=9rZeCNLfeuk\"><u>\u0434\u043e\u043a\u043b\u0430\u0434\u0435<\/u><\/a> \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b, \u043a\u0430\u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f MobX. \u0410 \u0432\u043e\u0442 \u0435\u0449\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/459706\/#comment_20382122\"><u>\u043e\u0434\u0438\u043d \u043e\u0442\u0437\u044b\u0432<\/u><\/a>, \u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0440 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430\u0441\u044c \u0432 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430.<\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0435 \u043c\u043d\u0435\u043d\u0438\u044f. \u0422\u044b\u0441\u044f\u0447\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0430 Stateofjs.com <a href=\"https:\/\/2018.stateofjs.com\/data-layer\/redux\/\"><u>\u043f\u0438\u0448\u0443\u0442<\/u><\/a>, \u0447\u0442\u043e \u0440\u0430\u0437\u0434\u0443\u0442\u043e\u0441\u0442\u044c (Bloated) \u0438 \u043a\u043e\u0440\u044f\u0432\u043e\u0441\u0442\u044c \u0441\u0442\u0438\u043b\u044f (Clumsy) \u2014 \u043e\u0434\u043d\u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043d\u0435\u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u0432 Redux. \u0420\u0430\u0437\u0434\u0443\u0442\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u043b\u044c\u0448\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0420\u0430\u0437\u0434\u0443\u0442\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u2014 \u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u0438\u0447\u0438\u043d, \u043f\u043e\u0447\u0435\u043c\u0443 \u0438\u043d\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u044f\u043d\u0435 \u0435\u0449\u0435 \u043d\u0435 \u0432\u044b\u0448\u043b\u0438 \u0441 \u043d\u0430\u043c\u0438 \u043d\u0430 \u0441\u0432\u044f\u0437\u044c.<\/p>\n<h4>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b MobX \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u043d\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c, \u2014 \u0432\u043c\u0435\u0441\u0442\u043e O(n) \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Redux.<\/p>\n<p><iframe id=\"5f7c90dd9e27cdc93030ef8a\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/5f7c90dd9e27cdc93030ef8a\" class=\"embed_video embed__content\"><\/iframe><\/p>\n<p>\u0422\u043e\u0440\u043c\u043e\u0437\u043d\u0443\u0442\u043e\u0441\u0442\u044c Redux \u0432\u0448\u0438\u0442\u0430 \u0432 \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0443. \u0412 JavaScript \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u0440\u043e\u0433\u0430\u044f \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435. \u0414\u0430\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u043f\u043e \u0432\u0441\u0435\u043c \u0440\u0435\u0434\u044c\u044e\u0441\u0435\u0440\u0430\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \u2014 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u0440\u043e\u0433\u043e, \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0440\u043e\u0436\u0435, \u0447\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435.<\/p>\n<p>\u0412 MobX \u0432\u044b \u043d\u0435 \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0430 \u0443 \u0432\u0430\u0441 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<h4>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 useContext<\/h4>\n<p>\u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e useContext \u043d\u0435 \u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u0432\u0430\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043c\u0430\u0437\u0430\u0442\u044c\u0441\u044f useMemo \u0438 useCallback.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <a href=\"https:\/\/codesandbox.io\/s\/summer-shadow-z703e\"><u>\u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/u><\/a> \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f @MaZaAa \u2014 alert() \u0432\u044b\u0441\u043a\u043e\u0447\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0435.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a MobX \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 shouldComponentUpdate, \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430 \u044d\u0442\u0438\u043c \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u2014 \u043f\u0435\u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e, \u0430 \u043d\u0435 \u0432\u0441\u0451 \u0434\u0435\u0440\u0435\u0432\u043e.<\/p>\n<h3>\u041d\u0435\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u043c\u0438\u043d\u0443\u0441\u044b MobX<\/h3>\n<p>1. \u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u044b \u0435\u0449\u0435 <a href=\"https:\/\/github.com\/tc39\/proposal-decorators\">\u043d\u0435 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435<\/a>, \u043d\u043e, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c <a href=\"https:\/\/mobx.js.org\/enabling-decorators.html\">\u0431\u0435\u0437 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u043e\u0432<\/a>, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/www.typescriptlang.org\/docs\/handbook\/decorators.html\">TypeScript<\/a>.<\/p>\n<p>2. \u041f\u044f\u0442\u044b\u0439 MobX \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 IE11, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 ES6 Proxy, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0438\u0444\u0438\u043b\u0438\u0442\u044c. \u0414\u043b\u044f \u043d\u0430\u0441 \u044d\u0442\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0441\u0435\u043c\u0438\u043b\u0435\u0442\u043d\u0435\u0439 \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0433\u043e \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0435 (\u0445\u043e\u0442\u044f \u0443\u0436\u0435 <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/microsoft-365-blog\/microsoft-365-apps-say-farewell-to-internet-explorer-11-and\/ba-p\/1591666\"><u>\u0441\u0430\u043c Microsoft<\/u><\/a> \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c), \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c MobX 4 \u0432\u0435\u0440\u0441\u0438\u0438 (UPD: \u0438\u043b\u0438 <a href=\"https:\/\/michel.codes\/blogs\/mobx6\"><u>MobX 6<\/u><\/a>).<\/p>\n<p>3. Redux \u0432 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u043e\u0434\u043a\u0443\u043f\u0438\u043b \u0441\u0432\u043e\u0438\u043c\u0438 \u0434\u0435\u0432-\u0442\u0443\u043b\u0437\u0430\u043c\u0438. \u0412 MobX \u0441 \u044d\u0442\u0438\u043c \u0442\u043e\u0436\u0435 \u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/mobxjs\/mobx-devtools\"><u>mobx-devtools<\/u><\/a> \u0438\u043b\u0438 mobx-remotedev.<\/p>\n<p>4. \u0414\u043b\u044f Server-side \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442 \u0441\u0442\u0435\u0439\u0442, \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0435\u0433\u043e \u0432 JSON \u0438 \u043a\u043b\u0430\u0434\u0443\u0442 \u0432 window.__PRELOADED_STATE__. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, MobX \u043d\u0438\u043a\u0430\u043a \u0432\u0430\u0441 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u0441\u0442\u0435\u0439\u0442. \u0422\u0430\u043c \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 JSON.<\/p>\n<p>\u041d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 \u0441\u0442\u0435\u0439\u0442\u0435, \u0442\u043e SSR \u0441 MobX \u2014 \u0434\u0430\u0432\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/medium.com\/@borisdedejski\/next-js-mobx-and-typescript-boilerplate-for-beginners-9e28ac190f7d\"><u>\u0432 \u0442\u043e\u043c \u0436\u0435 Nextjs<\/u><\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e useStaticRendering.<\/p>\n<p>5. \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043c\u0430\u0433\u0438\u0438. \u041c\u043d\u0435 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u0435\u043d \u044d\u0442\u043e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u044b\u0448\u0430\u0442\u044c, \u0447\u0442\u043e \u0432 MobX \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043c\u0430\u0433\u0438\u0438. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f, \u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u043d\u0430 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A2%D1%80%D0%B8_%D0%B7%D0%B0%D0%BA%D0%BE%D0%BD%D0%B0_%D0%9A%D0%BB%D0%B0%D1%80%D0%BA%D0%B0\"><u>\u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043c\u0430\u0433\u0438\u0435\u0439<\/u><\/a>. MobX \u2014 \u044d\u0442\u043e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A0%D0%B5%D0%B0%D0%BA%D1%82%D0%B8%D0%B2%D0%BD%D0%BE%D0%B5_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\"><u>\u043f\u0440\u043e\u0441\u0442\u043e FRP<\/u><\/a>, \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b. MobX \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0437\u0430 \u0432\u0430\u0441 \u0438 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e. \u041e\u043d \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442, \u043a \u043a\u0430\u043a\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0432\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0435\u0441\u044c, \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0438\u0445 \u0438 \u0442\u0430\u043a \u0441\u0442\u0440\u043e\u0438\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0439 \u0433\u0440\u0430\u0444.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 MobX \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/www.youtube.com\/watch?v=60atB_8FKkM\">\u0437\u0430 \u043f\u043e\u043b\u0447\u0430\u0441\u0430<\/a>.<\/p>\n<h3>\u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u043c\u0438\u043d\u0443\u0441\u044b MobX \u0438 \u043a\u0430\u043a \u0441 \u043d\u0438\u043c\u0438 \u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f<\/h3>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u043d\u0443\u0441 MobX \u2014 \u043e\u043d \u0434\u0430\u0435\u0442 \u0432\u0430\u043c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u044b \u0432 \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434, \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u0431\u043e\u0440\u043e\u043b\u0438\u0441\u044c \u0441 \u0438\u0437\u043b\u0438\u0448\u043d\u0435\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u043e\u0439.<\/p>\n<h4>\u041d\u0435 \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438<\/h4>\n<p>\u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0441\u043e \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u043e\u043c:<\/p>\n<pre><code class=\"xml\">&lt;h1&gt;{Store.count}&lt;\/h1&gt;  &lt;button onClick={Store.increase}&gt;   increment &lt;\/button&gt;<\/code><\/pre>\n<p>\u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u043e\u0442 \u0442\u0430\u043a, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u044f\u043c\u043e \u0432\u043e \u0432\u044c\u044e\u0445\u0435:<\/p>\n<pre><code class=\"xml\">&lt;button onClick={() =&gt; Store.count++}&gt;   increment &lt;\/button&gt;<\/code><\/pre>\n<p>\u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u043a \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0449\u0435 \u043d\u0430\u0448\u0438 \u0434\u0435\u0434\u044b \u0443\u0447\u0438\u043b\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 MVC.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/mobx.js.org\/refguide\/api.html#enforceactions\"><u>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043b\u0430\u0433 <\/u><\/a>enforceActions \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 MobX. \u041d\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0442\u044c \u0432\u0430\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435 \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c <a href=\"https:\/\/mobx.js.org\/actions.html\"><u>\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 Promise<\/u><\/a>.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 <a href=\"https:\/\/www.typescriptlang.org\/docs\/handbook\/classes.html#understanding-typescripts-private\"><u>\u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u0430\u043a private<\/u><\/a>. \u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430<\/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-311228","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311228","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=311228"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311228\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=311228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=311228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=311228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}