{"id":334055,"date":"2022-06-05T21:00:16","date_gmt":"2022-06-05T21:00:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=334055"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=334055","title":{"rendered":"<span>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0438 Redux \u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0447\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434?<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0434\u0430\u0432\u043d\u043e, \u043c\u043d\u0435 \u043f\u043e\u0432\u0435\u0437\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0433\u0434\u0435 \u0432\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a backend \u0431\u044b\u043b\u0438 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044b \u0432 action-creators \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 redux-thunk. \u042d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u043a\u0443\u043b\u044c\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Redux, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a backend \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 redux-saga.<\/p>\n<pre><code class=\"javascript\">export const getRepos = (username) => {   return async (dispatch) => {     const result = {       repos: [],     };     dispatch(loadingIn Progress (true));     try {       \/*await *\/ fetch(         `https:\/\/api.github.com\/users\/${username}\/repos?sort=updated`       )       .then((data) => data.json ())       .then((json) => (result.repos = json));     } finally {       dispatch(loadingInProgress (false));     }     dispatch(loadingSuccess (result));   }; };<\/code><\/pre>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 NDA \u044f \u043d\u0435 \u043c\u043e\u0433\u0443 \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b. \u041d\u043e \u044f \u043c\u043e\u0433\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f getRepos,\u00a0<strong>\u0438\u0437-\u0437\u0430 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 await<\/strong>, \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 reducer \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0443\u043b\u0435\u0442\u0438\u0442 \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 repos. \u041d\u0430 \u0431\u043e\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0436\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \ud83d\ude42<\/p>\n<pre><code class=\"javascript\">import React from \"react\"; import PropTypes from \"prop-types\";   class RepoList extends React.Component {   componentDidMount = () => {      setTimeout(() => this.forceUpdate(), 1_000);   };   render = () => {     const { repos, hasError, isLoading } = this.props;     ...<\/code><\/pre>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0441\u043c\u043e\u0433 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c\u00a0<strong>forceUpdate().\u00a0<\/strong>\u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u043e \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0438\u0439 \u0431\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u0435 \u043f\u0440\u0438 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0430, \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0430\u0432\u044f\u0449\u0438\u0432\u0430\u044f \u0438\u0434\u0435\u044f \u043e \u0442\u043e\u043c, \u0447\u0442\u043e Redux \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422\u0430\u043a \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0420\u0430\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0439 \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443.<\/p>\n<p>\u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<a href=\"https:\/\/vk.com\/away.php?to=https%3A%2F%2Fru.wikipedia.org%2Fwiki%2F%D4%F3%ED%EA%F6%E8%EE%ED%E0%EB%FC%ED%EE%E5_%EF%F0%EE%E3%F0%E0%EC%EC%E8%F0%EE%E2%E0%ED%E8%E5&amp;cc_key=\" rel=\"noopener noreferrer nofollow\"><u>pure<\/u><\/a>\u00a0\u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439?<\/p>\n<pre><code class=\"javascript\">const sum = (a, b) => a + b;<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0434\u0430, \u043e\u0434\u043d\u0430\u043a\u043e\u2026<\/p>\n<pre><code class=\"javascript\">const obj = new class {   toString() {      return Math.random().toString(36).substring(7);   }; };  console.log(sum(obj, obj)) \/\/ uretdln9iue console.log(sum(obj, obj)) \/\/ 61347arNc9q console.log(sum(obj, obj)) \/\/ 529n518wn718 <\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f pure \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c.<\/p>\n<pre><code class=\"javascript\">const sum = (a: number, b: number): number => a + b;<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u043e \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u043d\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0430\u0439\u0434-\u044d\u0444\u0444\u0435\u043a\u0442 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043d\u0430 \u0432\u0445\u043e\u0434 \u0443\u0436\u0435 \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435.<\/p>\n<pre><code class=\"javascript\">interface IObj {   toString(): string; }<\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 redux-form, \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u00a0<a href=\"https:\/\/vk.com\/away.php?to=https%3A%2F%2Fredux-form.com%2F8.2.2%2Fexamples%2Fselectingformvalues%2F&amp;cc_key=\" rel=\"noopener noreferrer nofollow\"><u>Selecting Form Values Example<\/u><\/a>.<\/p>\n<pre><code class=\"javascript\">import { connect } from 'react-redux' import { formValueSelector } from 'redux-form'   ...  const selector = formValueSelector('selectingFormValues') SelectingFormValuesForm = connect((state) => {   const hasEmailValue = selector(state, 'hasEmail')   const favoriteColorValue = selector(state, 'favoriteColor')   const { firstName, lastName } = selector(state, 'firstName', 'lastName')   return {     hasEmailValue,     favoriteColorValue,     canSubscribeByEmail: firstName &amp;&amp; lastName,     fullName: `${firstName || ''} S{lastName || ''}`,   }; })(SelectingFormValuesForm);<\/code><\/pre>\n<p>\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043a\u043e\u0434, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u0442\u044c\u00a0<strong>\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c<\/strong>\u00a0\u0438\u00a0<strong>\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u043c<\/strong>, \u043d\u043e \u043d\u0438\u043a\u0430\u043a\u00a0<strong>\u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c<\/strong>, \u0442\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u0435\u0439 \u043f\u0440\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0441\u0430\u0439\u0434-\u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>mapStateToProps\u00a0<\/strong>\u043f\u0440\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u043c\u0435\u0435\u0442 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043e\u043d \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u0430\u0432\u043a\u0430\u043c\u0438 ui. <strong>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u043d\u0435 \u043e\u0434\u043d\u0443, \u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0435\u0439 \u0437\u0430\u0434\u0430\u0447, \u043d\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0445 \u0438\u043c\u0435\u043d\u043d\u043e.<\/strong><\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041a\u043e\u043b\u043b\u0435\u0433\u0438! \u041f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u044b. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f \u043f\u043e\u043a\u0430\u0436\u0443\u0441\u044c \u0441\u0442\u0430\u0440\u043e\u043c\u043e\u0434\u043d\u044b\u043c, \u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 JSON \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443 \u0438 \u0440\u0435\u0448\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p><strong>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u044b \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439<\/strong><\/p>\n<blockquote>\n<p><em>\u041e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443 Create-Read-Update-Delete. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0432\u043e\u0434 \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0435\u0437 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f, \u0432\u044b \u043d\u0435 \u043e\u0431\u043e\u0439\u0434\u0435\u0442\u0435\u0441\u044c \u0431\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/em><\/p>\n<\/blockquote>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/strong><\/p>\n<blockquote>\n<p><em>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u00a0<\/em><strong><em>canSubscribeByEmail\u00a0<\/em><\/strong><em>\u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u0432\u044b\u0448\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043e \u043a \u043f\u043e\u043b\u044e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438 \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u043c, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u044f. JSON \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043d\u0435\u0441\u0442\u0438 \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u0438\u00a0<\/em><strong><em>isDisabled<\/em><\/strong><em>,\u00a0<\/em><strong><em>isInvalid<\/em><\/strong><em>,\u00a0<\/em><strong><em>isVisible\u00a0<\/em><\/strong><em>\u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043f\u043e\u043b\u044f\u043c, \u0447\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 \u0435\u0434\u0438\u043d\u0443\u044e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c<\/em><\/p>\n<\/blockquote>\n<p><strong>\u041c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0442\u043a\u0443<\/strong><\/p>\n<blockquote>\n<p><em>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u043b\u0435\u0439 \u0432\u0432\u043e\u0434\u0430 \u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0435\u0442\u043a\u043e\u0439 \u043d\u0430\u00a0<\/em><strong><em>phoneColomns<\/em><\/strong><em>,\u00a0<\/em><strong><em>tabletColumns<\/em><\/strong><em>,\u00a0<\/em><strong><em>desktopColumns<\/em><\/strong><em>, \u043b\u0435\u0433\u043a\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0438\u0440\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0440\u043e\u043b\u044c \u0438\u0433\u0440\u0430\u0435\u0442 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u043e\u0442\u0441\u0442\u0443\u043f\u044b<\/em><\/p>\n<\/blockquote>\n<p><strong>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043e\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c<\/strong><\/p>\n<blockquote>\n<p><em>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f backend \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0434\u0438\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 json:api, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<\/em><a href=\"https:\/\/vk.com\/away.php?to=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fnestjs-paginate&amp;cc_key=\" rel=\"noopener noreferrer nofollow\"><em><u>nest-paginate<\/u><\/em><\/a><em>, \u0442\u043e \u0434\u043b\u044f frontend \u044f \u0447\u0430\u0441\u0442\u043e \u043d\u0430\u0442\u044b\u043a\u0430\u043b\u0441\u044f \u043d\u0430 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043e\u043a \u0438 \u0432\u0435\u0440\u0441\u0442\u043a\u0438 \u0441\u043f\u0438\u0441\u043e\u0447\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u0447\u0435\u0440\u0435\u0437\u00a0<\/em><strong><em>&lt;List><\/em><\/strong><em>\u00a0\u0438\u00a0<\/em><strong><em>&lt;ListItem><\/em><\/strong><em>. \u042d\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/em><\/p>\n<\/blockquote>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u043a\u043e\u0434\u0435<\/h2>\n<p>\u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0440\u0430\u043d\u0435\u0435, \u0431\u044b\u043b\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043e\u0447\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u0438 \u0444\u043e\u0440\u043c\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430, \u0434\u0443\u043c\u0430\u044e, \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0432\u044b\u0436\u0438\u043c\u043a\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d5e\/214\/667\/d5e214667d9f8fdbb8af8a78bfc6d697.png\" alt=\"\u0421\u043f\u0438\u0441\u043e\u0447\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430\" title=\"\u0421\u043f\u0438\u0441\u043e\u0447\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430\" width=\"2910\" height=\"1594\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d5e\/214\/667\/d5e214667d9f8fdbb8af8a78bfc6d697.png\"\/><figcaption>\u0421\u043f\u0438\u0441\u043e\u0447\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430<\/figcaption><\/figure>\n<pre><code class=\"javascript\">const filters = [   {     type: FieldType.Text,     name: 'firstName',     title: 'First name',   },   {     type: FieldType.Text,     name: 'lastName',     title: 'Last name',   },   {     type: FieldType.Text,     name: 'occupation',     title: 'Occupation',   } ];  const sortModel = [   {     field: 'KPI',     sort: 'asc',   } ];  const columns = [   {     type: ColumnType.Component,     headerName: 'Avatar',     width: () => 65,     phoneOrder: 1,     minHeight: 60,     element: ({ avatar }) => (       \/*&lt;Box style={{ display: 'flex', alignItems: 'center' }}>         &lt;Avatar           src={avatar}           alt={avatar}         \/>       &lt;\/Box>*\/     ),   },   {     type: ColumnType.Compute,     primary: true,     field: 'name',     headerName: 'Name',     width: (fullWidth) => Math.max(fullWidth * 0.1, 135),     compute: ({ firstName, lastName }) => `${firstName} ${lastName}`,     },   {     type: ColumnType.Text,     field: 'occupation',     headerName: 'Occupation',     width: (fullWidth) => Math.max(fullWidth * 0.1, 115),   },   {     type: ColumnType.Component,     secondary: true,     field: 'KPI',     headerName: 'KPI index',     width: (fullWidth) => Math.max(fullWidth * 0.15, 200),     minHeight: 30,     element: ({ KPI, id }) => (       \/*&lt;div          style={{           display: 'flex',           justifyContent: 'flex-start',           alignItems: 'center',           cursor: 'pointer',         }}         onClick={(e) => {           e.preventDefault();           e.stopPropagation();           ioc.routerService.push(`\/indicators\/${id}`)         }}       >          &lt;span style={{         color: KPI &lt; 50 ? '#FA5F5A' : KPI &lt; 70 ? '#FE9B31' : '#7FB537',         display: 'flex',         alignItems: 'center'       }}>         &lt;span style={{ fontWeight: '900', marginRight: '1em' }}>           {`${KPI}%`}         &lt;\/span>           ({KPI &lt; 50 ? 'Review needed' : KPI &lt; 70 ? 'Warning' : 'High'})         &lt;\/span>       &lt;\/div>*\/     )   },   {     type: ColumnType.Text,     field: 'gender',     headerName: 'Gender',     width: (fullWidth) => Math.max(fullWidth * 0.08, 65),   },   {     type: ColumnType.Text,     field: 'age',     headerName: 'Age',     width: () => 50,   },   {     type: ColumnType.Text,     field: 'phone',     headerName: 'Phone number',     width: (fullWidth) => Math.max(fullWidth * 0.1, 150),   },   {     type: ColumnType.Text,     field: 'email',     headerName: 'Email',     width: (fullWidth) => Math.max(fullWidth * 0.15, 215),   },   {     type: ColumnType.Component,     field: 'countryFlag',     headerName: 'Country',     width: (fullWidth) => Math.max(fullWidth * 0.12, 150),     element: CountryFlag,   },   {     type: ColumnType.Action,     headerName: 'Actions',     sortable: false,     width: (fullWidth) => Math.max(fullWidth * 0.05, 50),   }, ];  const actions = [   {     type: ActionType.Menu,     options: [       {         action: 'resort-action',       },     ]   }, ];  const chips = [   {     label: 'High KPI',     name: 'high_kpi',     color: '#7FB537',   },   {     label: 'Warning KPI',     name: 'warning_kpi',     color: '#FE9B31',   },   {     label: 'Review KPI',     name: 'review_kpi',     color: '#FA5F5A',   } ];  const rowActions = [   {     label: 'Show perfomace indicators',     action: 'indicators-action',   }, ];  const heightRequest = () => window.innerHeight - 70; const widthRequest = () => window.innerWidth - 20;  export const ProfilesPage = () => {    const apiRef = useRef&lt;IListApi>(null);    const pickerHandler = async ({     firstName,     lastName,   }, {     limit,     offset,   }) => {      let rows = await Promise.resolve(mock) as IRowData[];      if (firstName) {       rows = rows.filter((row) => row.firstName.includes(firstName));     }      if (lastName) {       rows = rows.filter((row) => row.lastName.includes(lastName));     }      const { length: total } = rows;      rows = rows.slice(offset, limit + offset);      return {       rows,       total,     };    };    const [selectedRows, setSelectedRows] = useState&lt;RowId[]>([]);    const handleRowAction = (person: IPerson) => {     ioc.routerService.push(`\/indicators\/${person.id}`)   }    const handleAction = (name: string) => {     if (name === 'create'){       ioc.routerService.push(`\/profiles-list\/create`);     }   }    const handleClick = (person: IPerson) => {     ioc.routerService.push(`\/profiles-list\/${person.id}`);   };    const handleSelectedRows = (rows: RowId[]) => {     setSelectedRows(rows)     console.log(rows)   };    return (     &lt;ListTyped&lt;IFilterData, IPerson>       ref={apiRef}       title=\"Profiles\"       filterLabel=\"Filters\"       selectionMode={SelectionMode.Multiple}       heightRequest={heightRequest}       widthRequest={widthRequest}       rowActions={rowActions}       actions={actions}       filters={filters}       columns={columns}       handler={handler}       onSelectedRows={handleSelectedRows}       onRowAction={handleRowAction}       onRowClick={handleClick}       onAction={handleAction}       sortModel={sortModel}       chips={chips}     \/>   ); };<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/9b3\/790\/ca6\/9b3790ca6813c2c27d899c6d22307436.jpeg\" alt=\"\u0424\u043e\u0440\u043c\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430\" title=\"\u0424\u043e\u0440\u043c\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430\" width=\"2560\" height=\"1777\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9b3\/790\/ca6\/9b3790ca6813c2c27d899c6d22307436.jpeg\" data-blurred=\"true\"\/><figcaption>\u0424\u043e\u0440\u043c\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430<\/figcaption><\/figure>\n<pre><code class=\"javascript\"> const fields = [   {     type: FieldType.Group,     fieldBottomMargin: \"0\",     fields: [       {         type: FieldType.Group,         columns: \"2\",         phoneColumns: '12',         tabletColumns: '2',         style: {           overflow: 'hidden',         },         fields: [           {             type: FieldType.Component,             element: ({               avatar             }) => (               \/*&lt;AutoSizer target={document.body} selector={`.${MAIN_CONTENT}`}>                 {({ height }) => (                   &lt;img                     style={{                       background: '#0003',                       height: height,                       width: 'calc(100% - 10px)',                       objectFit: 'contain',                     }}                     src={avatar}                     loading=\"lazy\"                   \/>                 )}               &lt;\/AutoSizer>*\/             )           },           {             type: FieldType.Rating,             fieldBottomMargin: \"0\",             name: \"rating\",             defaultValue: 3           }         ]       },       {         type: FieldType.Group,         fieldBottomMargin: \"0\",         columns: \"10\",         phoneColumns: '12',         tabletColumns: '10',         fields: [           {             type: FieldType.Group,             className: MAIN_CONTENT,             fields: [               {                 type: FieldType.Div,                 style: {                   display: 'grid',                   gridTemplateColumns: 'auto 1fr 1fr',                 },                 fields: [                   {                     type: FieldType.Checkbox,                     fieldBottomMargin: \"0\",                     title: \"Enabled\",                   },                   {                     type: FieldType.Text,                     outlined: false,                     title: \"Identificator\",                     name: \"id\",                   },                   {                     type: FieldType.Group,                     fields: [                       {                         name: \"id\",                         type: FieldType.Text,                         outlined: false,                         title: \"Outer ID\",                       },                     ]                   },                  ],               },               {                 name: 'firstName',                 type: FieldType.Text,                 title: 'First name',                 description: 'Required',               },               {                 name: 'lastName',                 type: FieldType.Text,                 title: 'Last name',                 description: 'Required',               },               {                 name: 'age',                 type: FieldType.Text,                 title: 'Age',               },               {                 name: 'occupation',                 type: FieldType.Text,                 title: 'Occupation',                 description: 'Required',               },               {                 name: 'KPI',                 type: FieldType.Text,                 title: 'KPI index',               },               {                 type: FieldType.Combo,                 title: \"Gender\",                 placeholder: \"Choose\",                 name: \"gender\",                 itemList: [                   \"Male\",                   \"Female\",                   \"Other\"                 ]               },             ]           },           {             type: FieldType.Group,             fieldBottomMargin: \"0\",             columns: \"12\",             fields: [               {                 type: FieldType.Line,                 title: \"Contact Data\"               },               {                 name: 'email',                 type: FieldType.Text,                 title: 'E-mail',               },               {                 name: 'country',                 type: FieldType.Text,                 title: 'Country',               },               {                 name: 'phone',                 type: FieldType.Text,                 title: 'Phone number',               },             ]           },         ]       }     ]   } ]  export const OneProfilePage = ({   id, }) => {    const [data, setData] = useState(null);    const handleChange = (data: IPerson, initial: boolean) => {     if (!initial) {       setData(data);     }   };    const handleSave = async () => {     ...   };    const handleBack = () => {     ioc.routerService.push(`\/profiles-list`);   };    const handler = () => fetch(`\/api\/v1\/profiles\/${id}`);    return (     &lt;>       &lt;Breadcrumbs         title=\"Profiles\"         disabled={!data}         subtitle={id}         onSave={handleSave}         onBack={handleBack}       \/>       &lt;One         fields={fields}         handler={handler}         onChange={handleChange}       \/>     &lt;\/>   ); };<\/code><\/pre>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/669672\/\"> https:\/\/habr.com\/ru\/post\/669672\/<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0434\u0430\u0432\u043d\u043e, \u043c\u043d\u0435 \u043f\u043e\u0432\u0435\u0437\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0433\u0434\u0435 \u0432\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a backend \u0431\u044b\u043b\u0438 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044b \u0432 action-creators \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 redux-thunk. \u042d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u043a\u0443\u043b\u044c\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Redux, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a backend \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 redux-saga.<\/p>\n<pre><code class=\"javascript\">export const getRepos = (username) => {   return async (dispatch) => {     const result = {       repos: [],     };     dispatch(loadingIn Progress (true));     try {       \/*await *\/ fetch(         `https:\/\/api.github.com\/users\/${username}\/repos?sort=updated`       )       .then((data) => data.json ())       .then((json) => (result.repos = json));     } finally {       dispatch(loadingInProgress (false));     }     dispatch(loadingSuccess (result));   }; };<\/code><\/pre>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 NDA \u044f \u043d\u0435 \u043c\u043e\u0433\u0443 \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b. \u041d\u043e \u044f \u043c\u043e\u0433\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f getRepos,\u00a0<strong>\u0438\u0437-\u0437\u0430 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 await<\/strong>, \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 reducer \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0443\u043b\u0435\u0442\u0438\u0442 \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 repos. \u041d\u0430 \u0431\u043e\u0435\u0432\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0436\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \ud83d\ude42<\/p>\n<pre><code class=\"javascript\">import React from \"react\"; import PropTypes from \"prop-types\";   class RepoList extends React.Component {   componentDidMount = () => {      setTimeout(() => this.forceUpdate(), 1_000);   };   render = () => {     const { repos, hasError, isLoading } = this.props;     ...<\/code><\/pre>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0441\u043c\u043e\u0433 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c\u00a0<strong>forceUpdate().\u00a0<\/strong>\u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u043e \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0438\u0439 \u0431\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u0435 \u043f\u0440\u0438 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0430, \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0430\u0432\u044f\u0449\u0438\u0432\u0430\u044f \u0438\u0434\u0435\u044f \u043e \u0442\u043e\u043c, \u0447\u0442\u043e Redux \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0447\u0438\u0441\u0442\u043e\u0442\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422\u0430\u043a \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0420\u0430\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0439 \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443.<\/p>\n<p>\u042f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<a href=\"https:\/\/vk.com\/away.php?to=https%3A%2F%2Fru.wikipedia.org%2Fwiki%2F%D4%F3%ED%EA%F6%E8%EE%ED%E0%EB%FC%ED%EE%E5_%EF%F0%EE%E3%F0%E0%EC%EC%E8%F0%EE%E2%E0%ED%E8%E5&amp;cc_key=\" rel=\"noopener noreferrer nofollow\"><u>pure<\/u><\/a>\u00a0\u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439?<\/p>\n<pre><code class=\"javascript\">const sum = (a, b) => a + b;<\/code><\/pre>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0434\u0430, \u043e\u0434\u043d\u0430\u043a\u043e\u2026<\/p>\n<pre><code class=\"javascript\">const obj = new class {   toString() {      return Math.random().toString(36).substring(7);   }; };  console.log(sum(obj, obj)) \/\/ uretdln9iue console.log(sum(obj, obj)) \/\/ 61347arNc9q console.log(sum(obj, obj)) \/\/ 529n518wn718 <\/code><\/pre>\n<p>\u0412\u0435\u0440\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f pure \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c.<\/p>\n<pre><code class=\"javascript\">const sum = (a: number, b: number): number => a + b;<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u043e \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u043d\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0430\u0439\u0434-\u044d\u0444\u0444\u0435\u043a\u0442 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043d\u0430 \u0432\u0445\u043e\u0434 \u0443\u0436\u0435 \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435.<\/p>\n<pre><code class=\"javascript\">interface IObj {   toString(): string; }<\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0432 redux-form, \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u00a0<a href=\"https:\/\/vk.com\/away.php?to=https%3A%2F%2Fredux-form.com%2F8.2.2%2Fexamples%2Fselectingformvalues%2F&amp;cc_key=\" rel=\"noopener noreferrer nofollow\"><u>Selecting Form Values Example<\/u><\/a>.<\/p>\n<pre><code class=\"javascript\">import { connect } from 'react-redux' import { formValueSelector } from 'redux-form'   ...  const selector = formValueSelector('selectingFormValues') SelectingFormValuesForm = connect((state) => {   const hasEmailValue = selector(state, 'hasEmail')   const favoriteColorValue = selector(state, 'favoriteColor')   const { firstName, lastName } = selector(state, 'firstName', 'lastName')   return {     hasEmailValue,     favoriteColorValue,     canSubscribeByEmail: firstName &amp;&amp; lastName,     fullName: `${firstName || ''} S{lastName || ''}`,   }; })(SelectingFormValuesForm);<\/code><\/pre>\n<p>\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043a\u043e\u0434, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u0442\u044c\u00a0<strong>\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c<\/strong>\u00a0\u0438\u00a0<strong>\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u043c<\/strong>, \u043d\u043e \u043d\u0438\u043a\u0430\u043a\u00a0<strong>\u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c<\/strong>, \u0442\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u0435\u0439 \u043f\u0440\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0441\u0430\u0439\u0434-\u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>mapStateToProps\u00a0<\/strong>\u043f\u0440\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u043c\u0435\u0435\u0442 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043e\u043d \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u0430\u0432\u043a\u0430\u043c\u0438 ui. <strong>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u043d\u0435 \u043e\u0434\u043d\u0443, \u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0435\u0439 \u0437\u0430\u0434\u0430\u0447, \u043d\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0445 \u0438\u043c\u0435\u043d\u043d\u043e.<\/strong><\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041a\u043e\u043b\u043b\u0435\u0433\u0438! \u041f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u044b. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f \u043f\u043e\u043a\u0430\u0436\u0443\u0441\u044c \u0441\u0442\u0430\u0440\u043e\u043c\u043e\u0434\u043d\u044b\u043c, \u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 JSON \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443 \u0438 \u0440\u0435\u0448\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p><strong>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u044b \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439<\/strong><\/p>\n<blockquote>\n<p><em>\u041e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443 Create-Read-Update-Delete. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0432\u043e\u0434 \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0435\u0437 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f, \u0432\u044b \u043d\u0435 \u043e\u0431\u043e\u0439\u0434\u0435\u0442\u0435\u0441\u044c \u0431\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/em><\/p>\n<\/blockquote>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/strong><\/p>\n<blockquote>\n<p><em>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u00a0<\/em><strong><em>canSubscribeByEmail\u00a0<\/em><\/strong><em>\u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u0432\u044b\u0448\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043e \u043a \u043f\u043e\u043b\u044e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438 \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u043c, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u044f. JSON \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043d\u0435\u0441\u0442\u0438 \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u0438\u00a0<\/em><strong><em>isDisabled<\/em><\/strong><em>,\u00a0<\/em><strong><em>isInvalid<\/em><\/strong><em>,\u00a0<\/em><strong><em>isVisible\u00a0<\/em><\/strong><em>\u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043f\u043e\u043b\u044f\u043c, \u0447\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 \u0435\u0434\u0438\u043d\u0443\u044e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c<\/em><\/p>\n<\/blockquote>\n<p><strong>\u041c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0442\u043a\u0443<\/strong><\/p>\n<blockquote>\n<p><em>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u043b\u0435\u0439 \u0432\u0432\u043e\u0434\u0430 \u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0435\u0442\u043a\u043e\u0439 \u043d\u0430\u00a0<\/em><strong><em>phoneColomns<\/em><\/strong><em>,\u00a0<\/em><strong><em>tabletColumns<\/em><\/strong><em>,\u00a0<\/em><strong><em>desktopColumns<\/em><\/strong><em>, \u043b\u0435\u0433\u043a\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0438\u0440\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0440\u043e\u043b\u044c \u0438\u0433\u0440\u0430\u0435\u0442 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u043e\u0442\u0441\u0442\u0443\u043f\u044b<\/em><\/p>\n<\/blockquote>\n<p><strong>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043e\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c<\/strong><\/p>\n<blockquote>\n<p><em>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f backend \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0434\u0438\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 json:api, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<\/em><a href=\"https:\/\/vk.com\/away.php?to=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fnestjs-paginate&amp;cc_key=\" rel=\"noopener noreferrer nofollow\"><em><u>nest-paginate<\/u><\/em><\/a><em>, \u0442\u043e \u0434\u043b\u044f frontend \u044f \u0447\u0430\u0441\u0442\u043e \u043d\u0430\u0442\u044b\u043a\u0430\u043b\u0441\u044f \u043d\u0430 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043e\u043a \u0438 \u0432\u0435\u0440\u0441\u0442\u043a\u0438 \u0441\u043f\u0438\u0441\u043e\u0447\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u0447\u0435\u0440\u0435\u0437\u00a0<\/em><strong><em>&lt;List><\/em><\/strong><em>\u00a0\u0438\u00a0<\/em><strong><em>&lt;ListItem><\/em><\/strong><em>. \u042d\u0442\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/em><\/p>\n<\/blockquote>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u043a\u043e\u0434\u0435<\/h2>\n<p>\u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0440\u0430\u043d\u0435\u0435, \u0431\u044b\u043b\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043e\u0447\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u0438 \u0444\u043e\u0440\u043c\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430, \u0434\u0443\u043c\u0430\u044e, \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0432\u044b\u0436\u0438\u043c\u043a\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><figcaption>\u0421\u043f\u0438\u0441\u043e\u0447\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430<\/figcaption><\/figure>\n<pre><code class=\"javascript\">const filters = [   {     type: FieldType.Text,     name: 'firstName',     title: 'First name',   },   {     type: FieldType.Text,     name: 'lastName',     title: 'Last name',   },   {     type: FieldType.Text,     name: 'occupation',     title: 'Occupation',   } ];  const sortModel = [   {     field: 'KPI',     sort: 'asc',   } ];  const columns = [   {     type: ColumnType.Component,     headerName: 'Avatar',     width: () => 65,     phoneOrder: 1,     minHeight: 60,     element: ({ avatar }) => (       \/*&lt;Box style={{ display: 'flex', alignItems: 'center' }}>         &lt;Avatar           src={avatar}           alt={avatar}         \/>       &lt;\/Box>*\/     ),   },   {     type: ColumnType.Compute,     primary: true,     field: 'name',     headerName: 'Name',     width: (fullWidth) => Math.max(fullWidth * 0.1, 135),     compute: ({ firstName, lastName }) => `${firstName} ${lastName}`,     },   {     type: ColumnType.Text,     field: 'occupation',     headerName: 'Occupation',     width: (fullWidth) => Math.max(fullWidth * 0.1, 115),   },   {     type: ColumnType.Component,     secondary: true,     field: 'KPI',     headerName: 'KPI index',     width: (fullWidth) => Math.max(fullWidth * 0.15, 200),     minHeight: 30,     element: ({ KPI, id }) => (       \/*&lt;div          style={{           display: 'flex',           justifyContent: 'flex-start',           alignItems: 'center',           cursor: 'pointer',         }}         onClick={(e) => {           e.preventDefault();           e.stopPropagation();           ioc.routerService.push(`\/indicators\/${id}`)         }}       >          &lt;span style={{         color: KPI &lt; 50 ? '#FA5F5A' : KPI &lt; 70 ? '#FE9B31' : '#7FB537',         display: 'flex',         alignItems: 'center'       }}>         &lt;span style={{ fontWeight: '900', marginRight: '1em' }}>           {`${KPI}%`}         &lt;\/span>           ({KPI &lt; 50 ? 'Review needed' : KPI &lt; 70 ? 'Warning' : 'High'})         &lt;\/span>       &lt;\/div>*\/     )   },   {     type: ColumnType.Text,     field: 'gender',     headerName: 'Gender',     width: (fullWidth) => Math.max(fullWidth * 0.08, 65),   },   {     type: ColumnType.Text,     field: 'age',     headerName: 'Age',     width: () => 50,   },   {     type: ColumnType.Text,     field: 'phone',     headerName: 'Phone number',     width: (fullWidth) => Math.max(fullWidth * 0.1, 150),   },   {     type: ColumnType.Text,     field: 'email',     headerName: 'Email',     width: (fullWidth) => Math.max(fullWidth * 0.15, 215),   },   {     type: ColumnType.Component,     field: 'countryFlag',     headerName: 'Country',     width: (fullWidth) => Math.max(fullWidth * 0.12, 150),     element: CountryFlag,   },   {     type: ColumnType.Action,     headerName: 'Actions',     sortable: false,     width: (fullWidth) => Math.max(fullWidth * 0.05, 50),   }, ];  const actions = [   {     type: ActionType.Menu,     options: [       {         action: 'resort-action',       },     ]   }, ];  const chips = [   {     label: 'High KPI',     name: 'high_kpi',     color: '#7FB537',   },   {     label: 'Warning KPI',     name: 'warning_kpi',     color: '#FE9B31',   },   {     label: 'Review KPI',     name: 'review_kpi',     color: '#FA5F5A',   } ];  const rowActions = [   {     label: 'Show perfomace indicators',     action: 'indicators-action',   }, ];  const heightRequest = () => window.innerHeight - 70; const widthRequest = () => window.innerWidth - 20;  export const ProfilesPage = () => {    const apiRef = useRef&lt;IListApi>(null);    const pickerHandler = async ({     firstName,     lastName,   }, {     limit,     offset,   }) => {      let rows = await Promise.resolve(mock) as IRowData[];      if (firstName) {       rows = rows.filter((row) => row.firstName.includes(firstName));     }      if (lastName) {       rows = rows.filter((row) => row.lastName.includes(lastName));     }      const { length: total } = rows;      rows = rows.slice(offset, limit + offset);      return {       rows,       total,     };    };    const [selectedRows, setSelectedRows] = useState&lt;RowId[]>([]);    const handleRowAction = (person: IPerson) => {     ioc.routerService.push(`\/indicators\/${person.id}`)   }    const handleAction = (name: string) => {     if (name === 'create'){       ioc.routerService.push(`\/profiles-list\/create`);     }   }    const handleClick = (person: IPerson) => {     ioc.routerService.push(`\/profiles-list\/${person.id}`);   };    const handleSelectedRows = (rows: RowId[]) => {     setSelectedRows(rows)     console.log(rows)   };    return (     &lt;ListTyped&lt;IFilterD<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\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-334055","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/334055","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=334055"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/334055\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=334055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=334055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=334055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}