{"id":392509,"date":"2024-06-29T10:27:10","date_gmt":"2024-06-29T10:27:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=392509"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=392509","title":{"rendered":"<span>\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/725208\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/67\/ee\/_v\/67ee_vlphu2crtgtqcwm8rn8rea.png\" data-src=\"https:\/\/habrastorage.org\/webt\/67\/ee\/_v\/67ee_vlphu2crtgtqcwm8rn8rea.png\"\/><\/div>\n<p><\/a><br \/>  \u041a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u0432\u0441\u0451? \u041f\u0440\u043e\u0441\u0442\u043e? \u041d\u0435 \u0434\u0443\u043c\u0430\u044e!<\/p>\n<p>  \u042f \u0430\u0432\u0442\u043e\u0440 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f Reatom \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0445\u043e\u0447\u0443 \u0432\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u043a\u0438\u043b\u043b\u0435\u0440-\u0444\u0438\u0447\u0443 redux-saga \u0438 rxjs \u0438 \u043a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0449\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e \u0433\u0440\u044f\u0434\u0443\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435 ECMAScript.<\/p>\n<p>  \u0420\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e\u0431 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0442\u043c\u0435\u043d\u0435 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0445 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0446\u0435\u043f\u043e\u0447\u0435\u043a \u2014 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043b\u044e\u0431\u044b\u043c REST API \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0438\u043c\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2><font color=\"#3AC1EF\">\u258d \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/font><\/h2>\n<pre><code class=\"javascript\">const getA = async () => {   const a = await api.getA();   return a; };  const getB = async (params) => {   const b = await api.getB(params);   return b; };  export const event = async () => {   const a = await getA();   const b = await getB(a);   setState(b); }; <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0431\u0430\u043d\u0430\u043b\u0435\u043d, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0438\u0441\u0430\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434: \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0441 \u0431\u0435\u043a\u0435\u043d\u0434\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0434\u043d\u0438 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u0442\u043e\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430. \u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043e\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430, \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438\u043b\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0447\u0442\u043e-\u0442\u043e \u043c\u0435\u043d\u044f\u0435\u0442, \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u0435\u043d\u044f\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0451, \u0430 \u043d\u0430\u043c \u0443\u0436\u0435 \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u043b \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041f\u043e\u043a\u0430 \u043d\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c\u0441\u044f, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u00abweird state\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/yb\/wh\/ts\/ybwhtsmf7_slpz4htr_nbm70atg.png\" data-src=\"https:\/\/habrastorage.org\/webt\/yb\/wh\/ts\/ybwhtsmf7_slpz4htr_nbm70atg.png\"\/><\/p>\n<p>  \u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0451 \u0435\u0440\u0443\u043d\u0434\u0430. \u041f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0431\u0435\u043a\u0435\u043d\u0434 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0435 \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u043e\u0447\u0435\u0440\u0451\u0434\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0430 \u043f\u043e\u0442\u043e\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u2014 \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u044d\u0442\u043e \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043a \u0441\u0442\u0430\u0440\u044b\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c, \u0430 \u043d\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u043a \u0438 \u043d\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u2014 \u00abWAT state\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/67\/ee\/_v\/67ee_vlphu2crtgtqcwm8rn8rea.png\" data-src=\"https:\/\/habrastorage.org\/webt\/67\/ee\/_v\/67ee_vlphu2crtgtqcwm8rn8rea.png\"\/><\/p>\n<p>  \u041a\u0430\u043a \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c WAT state \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435? \u0414\u0430 \u0432\u0440\u043e\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/c5\/ae\/r2\/c5aer2zcuvpg2v0zqmhba2jdevu.png\" data-src=\"https:\/\/habrastorage.org\/webt\/c5\/ae\/r2\/c5aer2zcuvpg2v0zqmhba2jdevu.png\"\/><\/p>\n<p>  \u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u043c\u0435\u043d\u0443 \u043d\u0435 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e, \u0445\u043e\u0442\u044f \u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c, \u043d\u0435 \u0443 \u0432\u0441\u0435\u0445 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439. \u0422\u043e\u0442 \u0436\u0435 axios \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0442\u0430\u043a\u043e\u0439 \u0444\u0438\u0447\u0438 \u043d\u0435 \u0434\u0430\u0451\u0442, \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b \u043e\u0442\u043c\u0435\u043d\u044b, \u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u043c\u0443. \u041d\u0438\u043a\u0430\u043a\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u043a\u0438.<\/p>\n<p>  \u041a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443? \u041f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0442\u043c\u0435\u043d\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">let aVersion = 0; const getA = async () => {   const version = ++aVersion;   const a = await api.getA();   if (version !== aVersion) throw new Error(\"aborted\");   return a; };  let bVersion = 0; const getB = async (params) => {   const version = ++bVersion;   const b = await api.getB(params);   if (version !== bVersion) throw new Error(\"aborted\");   return b; };  export const event = async () => {   const a = await getA();   const b = await getB(a);   setState(b); }; <\/code><\/pre>\n<p>  \u0411\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u043d\u0435\u043d\u044c\u043a\u043e? \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0451. \u041c\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u00abWAT state\u00bb, \u0430 \u043a\u0430\u043a \u0436\u0435 \u00abweird state\u00bb?<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ro\/fc\/eo\/rofceoaj9ns6llcujyf7apumetc.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ro\/fc\/eo\/rofceoaj9ns6llcujyf7apumetc.png\"\/><\/p>\n<p>  \u041d\u0430\u0448\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0438 \u043a \u0447\u0435\u043c\u0443 \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442! \u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u0434\u0443\u0442 \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0438 \u043d\u0435 \u043e\u0431\u0433\u043e\u043d\u044f\u044e\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0440\u043d\u044b\u043c, \u043d\u043e \u0442\u043e \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u0440\u0446\u0430\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u041a\u0430\u043a \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c? \u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0431\u0435\u043a\u0435\u043d\u0434, \u043d\u043e \u0438 \u0432\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0446\u0435\u043f\u043e\u0447\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u2014 \u0435\u0435 \u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c! \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u0432\u0443\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u0432\u0435\u0434\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0438.<\/p>\n<pre><code class=\"javascript\">const getA = async (getVersion) => {   const version = getVersion();   const a = await api.getA();   if (version !== getVersion()) throw new Error(\"aborted\");   return a; };  const getB = async (getVersion, params) => {   const version = getVersion();   const b = await api.getB(params);   if (version !== getVersion()) throw new Error(\"aborted\");   return b; };  let version = 0 const getVersion = () => version export const event = async () => {   version++   const a = await getA(getVersion);   const b = await getB(getVersion, a);   setState(b); }; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 <code>getVersion<\/code> \u0438\u0437 \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u044f, \u0442.\u043a. \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0443 \u043d\u0430\u0441 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0431\u0440\u043e\u0441\u0430\u043d\u044b \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c, \u0438 \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u2014 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c.<\/p>\n<p>  \u0417\u0430\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0435\u043d\u0430! \u041e\u0442\u043c\u0435\u043d\u0430 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u00abweird state\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/wo\/a-\/ja\/woa-jaty3vdisgb0pvlu2ssbtyy.png\" data-src=\"https:\/\/habrastorage.org\/webt\/wo\/a-\/ja\/woa-jaty3vdisgb0pvlu2ssbtyy.png\"\/><\/p>\n<p>  \u00abWAT state\u00bb \u2014 \u0442\u043e\u0436\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/wx\/fd\/km\/wxfdkm_pyp4-1s3nwxhrqnpnseq.png\" data-src=\"https:\/\/habrastorage.org\/webt\/wx\/fd\/km\/wxfdkm_pyp4-1s3nwxhrqnpnseq.png\"\/><\/p>\n<p>  \u041d\u043e \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u0432\u0435\u0440\u0431\u043e\u0437\u043d\u043e. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0435\u0433\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 AbortController, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 \u0438 node.js.<\/p>\n<pre><code class=\"javascript\">const getA = async (controller) => {   const a = await api.getA();   controller.throwIfAborted();   return a; };  const getB = async (controller, params) => {   const b = await api.getB(params);   controller.throwIfAborted();   return b; };  let controller = new AbortController(); export const event = async () => {   controller.abort(\"concurrent\");   controller = new AbortController();   const a = await getA(controller);   const b = await getB(controller, a);   setState(b); }; <\/code><\/pre>\n<p>  \u0421\u0442\u0430\u043b\u043e \u043b\u0443\u0447\u0448\u0435 \u0438, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435, \u043d\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438, \u0441\u0442\u043e\u0438\u0442 \u043e\u043d\u043e \u0442\u043e\u0433\u043e? \u041d\u0430 \u043c\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0442\u0430\u043a \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u043b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e \u0438 \u043a\u043e\u0434 \u0431\u044b\u043b \u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u0435\u0435, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0422\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 async, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/elizarov.medium.com\/how-do-you-color-your-functions-a6bb423d936d\">How do you color your functions?<\/a>. \u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0439, \u0430 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 \u043f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0438 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0435\u0435.<\/p>\n<p>  \u041a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b? rxjs \u0438 redux-saga \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u0430\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u0441\u0432\u043e\u0451\u043c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c API, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0440\u0435\u043a\u0430\u0435\u0442 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0446\u0435\u043f\u043e\u0447\u0435\u043a \u0438 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u044d\u0442\u0438\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0432 API \u2014 \u043e\u043d\u043e \u043d\u0443 \u043e\u0447\u0435\u043d\u044c \u0443\u0436 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0435, \u043a\u0430\u043a \u043f\u043e \u0432\u0438\u0434\u0443, \u0442\u0430\u043a \u0438 \u043f\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u2014 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0434\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439. \u0425\u043e\u0442\u044c \u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0432 $mol \u2014 \u0434\u0430, \u043e\u043d \u0442\u043e\u0436\u0435 \u0443\u043c\u0435\u0435\u0442 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0442\u043c\u0435\u043d\u0443.<\/p>\n<p>  \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 rxjs.<\/p>\n<pre><code class=\"javascript\"> import { from, Subject } from 'rxjs'; import { switchMap } from 'rxjs\/operators';  const getA = async () => {   const a = await api.getA();   return a; };  const getB = async (params) => {   const b = await api.getB(params);   return b; };  export const event$ = new Subject(); event$   .pipe(     switchMap(() => from(getA())),     switchMap((a) => from(getB(a)))   )   .subscribe((b) => setState(b)); <\/code><\/pre>\n<p>  \u0412 <code>@reduxjs\/toolkit<\/code> \u0435\u0441\u0442\u044c <code>createListenerMiddleware<\/code>, \u0432 API \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0438\u0447\u0438 \u0438\u0437 redux-saga, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0438 \u043d\u0435 \u0442\u0430\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432\u043e \u0432\u0441\u0451 API \u0442\u0443\u043b\u043a\u0438\u0442\u0430.<\/p>\n<p>  \u041a\u0430\u043a\u0438\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b?<\/p>\n<h2><font color=\"#3AC1EF\">\u258d \u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/font><\/h2>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0442\u043c\u0435\u043d\u0443, \u043d\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0430\u044f \u2014 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u044b\u0437\u043e\u0432\u0430. \u041d\u0430 \u0431\u0435\u043a\u0435\u043d\u0434\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0435\u0441\u0442\u044c \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0430\u0436\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0412 node.js \u0435\u0441\u0442\u044c <a href=\"https:\/\/nodejs.org\/api\/async_context.html\">AsyncLocalStorage<\/a> \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0434\u0451\u0442 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e \u0435\u0433\u043e \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044e \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 (<a href=\"https:\/\/docs.google.com\/presentation\/d\/1LLcZxYyuQ1DhBH1htvEFp95PkeYM5nLSrlQoOmWpYEI\/edit#slide=id.p\">Ecma TC39 proposal slides<\/a>)! \u041a\u043e\u0434 \u0441 \u043d\u0438\u043c \u043c\u043e\u0433 \u0431\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0432 <code>context<\/code> \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 AbortController:<\/p>\n<pre><code class=\"javascript\"> const asyncContext = new AsyncContext(new AbortController());  const getA = async () => {   const a = await api.getA();   asyncContext.get().throwIfAborted();   return a; };  const getB = async (params) => {   const b = await api.getB(params);   asyncContext.get().throwIfAborted();   return b; };  export const event = async () => {   asyncContext.get().abort(\"concurrent\");   asyncContext.set(new AbortController());   const a = await getA();   const b = await getB(a);   setState(b); }; <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0449\u0435. \u042f \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e (\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u0443\u044e, \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0443\u043f\u0435\u043d\u0447\u0430\u0442\u0443\u044e) \u043b\u043e\u0433\u0438\u043a\u0443 \u0431\u0435\u0437 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u0422\u043e\u0447\u043d\u0435\u0435, \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430\u0434\u0451\u0436\u043d\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>  \u0415\u0441\u0442\u044c \u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441, \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u043e\u043b\u0438\u0444\u0438\u043b\u044b? \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435\u0442. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0430\u043d\u0433\u0443\u043b\u044f\u0440\u0430 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 zone.js, \u043d\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435 \u043a\u0435\u0439\u0441\u044b \u0442\u0430\u043a \u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0435 \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432 Reatom \u2014 \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 <code>ctx<\/code>. \u042d\u0442\u043e \u043a\u043e\u043d\u0432\u0435\u043d\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u043e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u0430\u044f, \u0432 <code>ctx<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0430\u0439\u0434-\u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438, \u043e\u043d \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u0435\u043d \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u044d\u0442\u043e\u043c \u0432 \u0434\u0435\u0431\u0430\u0433\u0435, \u0430 \u0435\u0449\u0451 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f!<\/p>\n<p>  \u041d\u043e \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0438\u043c \u0431\u0430\u0440\u0430\u043d\u0430\u043c \u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0442\u043c\u0435\u043d\u0430. \u0412 \u043f\u0430\u043a\u0435\u0442\u0435 <a href=\"https:\/\/www.reatom.dev\/packages\/async\">reatom\/async<\/a> \u0435\u0441\u0442\u044c \u0444\u0430\u0431\u0440\u0438\u043a\u0430 <code>reatomAsync<\/code> \u0434\u043b\u044f \u0437\u0430\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0442\u0440\u0435\u043a\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0449\u0435\u0442 \u0432 \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0435\u043c <code>ctx<\/code> AbortController \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e. \u0421\u0430\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>withAbort<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430 \u0432\u0430\u0441 \u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<pre><code class=\"javascript\"> import { reatomAsync, withAbort } from '@reatom\/async'  const getA = reatomAsync(async (ctx) => {   const a = await api.getA();   return a; });  const getB = reatomAsync(async (ctx, params) => {   const b = await api.getB(params);   return b; });  export const event = reatomAsync(async (ctx) => {   const a = await getA(ctx);   const b = await getB(ctx, a);   setState(b); }).pipe(withAbort()); <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0410 \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0430\u043d\u0434\u043b\u0430 \u0432 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 rxjs. \u041f\u0440\u0435\u043b\u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <code>ctx<\/code> \u2014 \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 API \u0432 Reatom \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 AbortController \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e. \u0418 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u2014 \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430, \u043e\u043d \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u043d\u0430\u043d\u0438\u0439 \u0438\u043b\u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0439 \u2014 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043d\u0432\u0435\u043d\u0446\u0438\u044e \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e. \u041d\u043e \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0432 \u043d\u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0438\u0447\u0438. \u0427\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u0435\u043d \u0438 \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0440\u0435\u0434\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0430\u043c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0445\u0432\u0430\u0442\u0430\u0442\u044c <a href=\"https:\/\/www.reatom.dev\/packages\/logger\">@reatom\/logger<\/a> \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c, \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0433\u0430\u0439\u0434 \u043f\u0440\u043e \u044d\u0442\u043e.<\/p>\n<p>  \u041f\u043e\u0432\u0442\u043e\u0440\u044e\u0441\u044c, \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442\u043c\u0435\u043d\u044b \u0432 Reatom \u043e\u0442 rxjs \u0438 redux-saga \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e AbortController, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 \u0438 node.js, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a! \u0412\u043d\u0443\u0442\u0440\u0438 <code>reatomAsync<\/code> \u0441\u0430\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 (<code>ctx.controler<\/code>) \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0442\u043c\u0435\u043d\u044b \u0438\u043b\u0438 \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c <code>signal<\/code> \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 fetch. \u041e\u0442\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u0442.\u043a. \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u0448\u044c ~6 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439. \u0418 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 AbortController, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0448\u0438\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043c\u043e\u0433\u0443\u0442 \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u0435\u0436\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u041a\u0440\u0443\u0442\u043e \u0435\u0449\u0451 \u0438 \u0442\u043e, \u0447\u0442\u043e Reatom \u0438 \u0435\u0433\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 \u043c\u043e\u043d\u043e\u0440\u0435\u043f\u0435 \u0438 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/www.reatom.dev\/packages\/hooks#onconnect\">onConnect \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 @reatom\/hooks<\/a> \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u0442 AbortController \u0438 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u0438 \u043e\u0442\u043f\u0438\u0441\u043a\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u0442\u043e\u043c\u0430 \u2014 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u0438 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u0435\u0435 useEffect \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043b\u0431\u0435\u043a\u0430 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0432 React.<\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b \u0443\u0437\u043d\u0430\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435. \u041e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432 \u0432\u0438\u0434\u0435\u043e\u0444\u043e\u0440\u043c\u0430\u0442\u0435:<\/p>\n<div class=\"oembed\">\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/64355caaaa6282efd5d6a0a8\" data-style=\"\" id=\"64355caaaa6282efd5d6a0a8\" width=\"\"><\/div>\n<\/div>\n<p>\u042d\u0442\u043e \u0432\u0441\u0451, \u0447\u0442\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c. \u0417\u043d\u0430\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u0442\u043c\u0435\u043d\u0443? \u041a\u0430\u043a \u0432\u0430\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0440\u0443\u0447\u043d\u044b\u043c \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u043d\u0438\u0435\u043c AbortController, \u0434\u0435\u043b\u0430\u043b\u0438 \u043b\u0438 \u0432\u044b \u0442\u0430\u043a \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c?<\/p>\n<blockquote><p><b><font color=\"#3AC1EF\"><a href=\"https:\/\/t.me\/ruvds_community\">Telegram-\u043a\u0430\u043d\u0430\u043b \u0441 \u0440\u043e\u0437\u044b\u0433\u0440\u044b\u0448\u0430\u043c\u0438 \u043f\u0440\u0438\u0437\u043e\u0432, \u043d\u043e\u0432\u043e\u0441\u0442\u044f\u043c\u0438 IT \u0438 \u043f\u043e\u0441\u0442\u0430\u043c\u0438 \u043e \u0440\u0435\u0442\u0440\u043e\u0438\u0433\u0440\u0430\u0445 ?\ufe0f<\/a><\/font><\/b><\/p><\/blockquote>\n<p><a href=\"http:\/\/ruvds.com\/ru-rub?utm_source=habr&amp;utm_medium=article&amp;utm_campaign=Artalar&amp;utm_content=otmenit_nelzya_prodolzhit\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/_p\/_h\/lv\/_p_hlvd2tv0cv9tny8tdytzfhje.png\" data-src=\"https:\/\/habrastorage.org\/webt\/_p\/_h\/lv\/_p_hlvd2tv0cv9tny8tdytzfhje.png\"\/><\/a><\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/725208\/\"> https:\/\/habr.com\/ru\/articles\/725208\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/725208\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/67\/ee\/_v\/67ee_vlphu2crtgtqcwm8rn8rea.png\" data-src=\"https:\/\/habrastorage.org\/webt\/67\/ee\/_v\/67ee_vlphu2crtgtqcwm8rn8rea.png\"\/><\/div>\n<p><\/a><br \/>  \u041a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u0432\u0441\u0451? \u041f\u0440\u043e\u0441\u0442\u043e? \u041d\u0435 \u0434\u0443\u043c\u0430\u044e!<\/p>\n<p>  \u042f \u0430\u0432\u0442\u043e\u0440 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f Reatom \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0445\u043e\u0447\u0443 \u0432\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u043a\u0438\u043b\u043b\u0435\u0440-\u0444\u0438\u0447\u0443 redux-saga \u0438 rxjs \u0438 \u043a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0449\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e \u0433\u0440\u044f\u0434\u0443\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435 ECMAScript.<\/p>\n<p>  \u0420\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e\u0431 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0442\u043c\u0435\u043d\u0435 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0445 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0446\u0435\u043f\u043e\u0447\u0435\u043a \u2014 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043b\u044e\u0431\u044b\u043c REST API \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0438\u043c\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-392509","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/392509","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=392509"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/392509\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=392509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=392509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=392509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}