{"id":386117,"date":"2024-06-29T06:31:26","date_gmt":"2024-06-29T06:31:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=386117"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=386117","title":{"rendered":"<span>Pinia scoped store<\/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<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h2>\n<p>\u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u0432\u0441\u0435 \u0441\u0442\u0435\u0439\u0442-\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Vue (\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e Vuex, \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 Pinia, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430) \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0435 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u043a \u043a\u043e\u0440\u043d\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0418 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e: \u0434\u0443\u043c\u0430\u044e, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0431\u0435\u043d\u0435\u0444\u0438\u0442\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u0431\u0443\u0434\u044c \u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0442\u043e\u0440\u0443 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u043e \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 &#8212; \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 Pinia \u0441\u0442\u043e\u0440\u0430 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0434\u043b\u044f <strong>\u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432<\/strong> \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\/\u043c\u043e\u0434\u0443\u043b\u044f. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>\u041c\u044b \u0432 YCLIENTS \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u043a\u043e\u0433\u0434\u0430 \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0443\u043f\u043d\u044b\u0439 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u043f\u043b\u0430\u0442 \u043c\u0435\u0436\u0434\u0443 \u0432\u043a\u043b\u0430\u0434\u043a\u0430\u043c\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430. \u0412 \u043e\u043a\u043d\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u043c\u043e\u0434\u0443\u043b\u044f, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u0435 \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u0447\u0442\u043e \u0432 \u0440\u0430\u0437\u0440\u0435\u0437 \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0435\u0439 \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0438\u0437 Pinia.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b21\/d50\/775\/b21d50775bb2d3a729a43fa9c525ff1f.gif\" alt=\"\" title=\"\" width=\"800\" height=\"395\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b21\/d50\/775\/b21d50775bb2d3a729a43fa9c525ff1f.gif\"\/><\/figure>\n<p>\u0421 \u043f\u043e\u0445\u043e\u0436\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c <a href=\"https:\/\/github.com\/vuejs\/pinia\/discussions\/840\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Pinia \u043d\u0430 GitHub<\/u><\/a>:<\/p>\n<blockquote>\n<p>C\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u0435\u0439\u0441\u044b, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u0442\u0430\u0433\u0440\u0438\u0434\u043e\u0432 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0430\u0442\u0430\u0433\u0440\u0438\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430<\/p>\n<\/blockquote>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u043e frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0435\u0442 \u0435\u0434\u0438\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u043e\u0440\u0430\u043c\u0438. \u0412 \u043d\u0438\u0445 \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e \u0442\u0438\u043f\u0443 \u0438 \u043e\u0431\u044a\u0435\u043c\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0435. \u041c\u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0433\u0434\u0435 \u0434\u0430\u0436\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b\/\u0431\u043b\u043e\u043a\u0438 \u0438\u043c\u0435\u043b\u0438 \u0441\u0432\u043e\u0438 \u0441\u0442\u043e\u0440\u044b. \u0412 \u0446\u0435\u043b\u043e\u043c \u0441\u0442\u043e\u0440\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u2014 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0442\u0440\u0435\u043d\u0434\u043e\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043e\u0442 \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449 (Pinia \u0438 Effector \u044f\u0440\u043a\u0438\u0439 \u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440). \u0412\u0441\u0451 \u044d\u0442\u043e (\u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u0438 \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0438 \u0438 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u043e\u0440\u0430\u043c\u0438) \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439.<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430<\/h3>\n<p>\u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043f\u043e\u0434 \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0435\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e (\u043f\u0440\u0438 \u0441\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u0435\u0439\u043d\u0442\u0435\u043d\u0435\u0440\u043e\u0432 Pinia) \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439 (<a href=\"https:\/\/github.com\/vuejs\/pinia\/discussions\/840?sort=old#discussioncomment-2784643\" rel=\"noopener noreferrer nofollow\"><u>\u0440\u0430\u0437<\/u><\/a> \u0438 <a href=\"https:\/\/github.com\/vuejs\/pinia\/discussions\/840?sort=old#discussioncomment-3210443\" rel=\"noopener noreferrer nofollow\"><u>\u0434\u0432\u0430<\/u><\/a>). \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0445 \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043e\u0434\u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0442\u043e\u0440\u0443 (\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445 \u0432\u044b\u0448\u0435 \u044d\u0442\u043e tableId \u0438\u043b\u0438 listViewId). \u0411\u0435\u0437 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e Pinia. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 (\u0432\u0435\u0434\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0442\u043e\u0440\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e) \u0432\u0441\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c-\u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c. \u0420\u0435\u0448\u0438\u0432 \u043e\u0434\u043d\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0443\u044e.<\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/ccqgithub\/pinia-di\" rel=\"noopener noreferrer nofollow\"><u>pinia-di<\/u><\/a>. \u0421 \u0435\u0435 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 Pinia. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0435\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0438\u0434\u0435\u0442 \u0432\u0440\u0430\u0437\u0440\u0435\u0437 \u0441 \u0433\u043b\u0430\u0432\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438 \u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438 Pinia: \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c\u044e. \u041a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441.<\/p>\n<h2>\u041c\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h2>\n<p>Pinia \u0441\u0442\u043e\u0440, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u043a \u0441\u043a\u043e\u0443\u043f\u0443 (\u0438\u043b\u0438 <strong>Pinia scoped \u0441\u0442\u043e\u0440<\/strong>). \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043a\u043e\u0443\u043f\u043e\u043c (\u0438\u043b\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u044c\u044e \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0432\u044b\u043c \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u043e\u0440. \u0412\u0441\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0441\u0442\u043e\u0440\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, <strong>\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0441\u043a\u043e\u0443\u043f\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c<\/strong>, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u043b\u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u043e\u0440\u0430\u043c\u0438. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u0441\u0442\u043e\u0440, \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043c\u043a\u0438 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/284\/359\/1af\/2843591af54984450dd39bd39103d67c.png\" alt=\"\" title=\"\" width=\"1600\" height=\"705\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/284\/359\/1af\/2843591af54984450dd39bd39103d67c.png\"\/><\/figure>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u043e\u0440 (storeModuleName\/3 \u0438 storeModuleName\/6 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0432\u044b\u0448\u0435), \u0441\u043a\u043e\u0443\u043f\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<p>\u042d\u0442\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0434\u0432\u0443\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0439:<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u0430 (\u0432\u044b\u0437\u043e\u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e defineStore()) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u043a \u0441\u043a\u043e\u0443\u043f\u0443(\u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430)<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u0441\u043a\u043e\u0443\u043f\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f provide\/inject. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c, \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 useStore<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u0437\u044f\u0442 <a href=\"https:\/\/github.com\/vuejs\/pinia\/blob\/v2\/packages\/pinia\/src\/store.ts#L852\" rel=\"noopener noreferrer nofollow\"><u>source \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 defineStore<\/u><\/a>. \u0422\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438\u0437 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0430 (Vue core team \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 as \u0438 any, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0445 \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c). \u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e\u043c\u0443 \u0448\u0430\u0433\u0443:<\/p>\n<pre><code class=\"typescript\">import {defineStore, Pinia, StoreDefinition, StoreGeneric, getActivePinia} from 'pinia' import {inject, getCurrentInstance, onUnmounted, ComponentInternalInstance, InjectionKey} from 'vue'  \/\/ id \u0438 piniaId. \/\/ id - \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 defineScopeYcStore. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, RecordAcquiringPaymentRedesign. \/\/ piniaId - id \u0441\u0442\u043e\u0440\u0430 \u0432 pinia, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0442\u043e\u0440 \u0441\u043a\u043e\u0443\u043f\u0430. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, RecordAcquiringPaymentRedesign\/123124123123123, \u0433\u0434\u0435 123124123123123 - \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043a\u043e\u0443\u043f\u0430(\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0441\u043a\u043e\u0443\u043f\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f uid \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0441\u0442\u043e\u0440) \/\/ \/\/ scopedStoresIdsByScope \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u0432 \u043a\u0430\u043a\u0438\u0445 \u0441\u043a\u043e\u0443\u043f\u0430\u0445(scopeId) \u0438 \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u0440\u044b(id \u0438 piniaId) \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c. \/\/ \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u043e\u0443\u043f\u0430(scopeId) \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c id \u0438 piniaId \u0432\u0441\u0435\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043a\u043e\u0443\u043f\u0435 \u0441\u0442\u043e\u0440\u043e\u0432. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u0432 \u0441 \u043e\u0434\u043d\u0438\u043a\u043e\u0432\u044b\u043c \u0441\u043a\u043e\u0443\u043f\u043e\u043c type ScopedStoresIds = {[id in string]: string} \/\/ {RecordAcquiringPaymentRedesign: 'RecordAcquiringPaymentRedesign\/123124123123123', ...} const scopedStoresIdsByScope: {[scopeId in string]: ScopedStoresIds} = {} \/\/ {123123: {RecordAcquiringPaymentRedesign: 'RecordAcquiringPaymentRedesign\/123124123123123', ...}}  \/\/  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u043d\u0435\u0435 scoped \u0441\u0442\u043e\u0440\u044b. \u041a\u043b\u044e\u0447\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f piniaId, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c - \u0441\u0442\u043e\u0440 const scopedStoresByPiniaId: {[piniaId in string]: ReturnType&lt;typeof defineStore>} = {}  export const defineScopedStore: typeof defineStore = function( \/\/ \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 \u0441\u043e\u0440\u0441\u043e\u0432 defineStore (https:\/\/github.com\/vuejs\/pinia\/blob\/v2\/packages\/pinia\/src\/store.ts#L852)   idOrOptions: any,   setup?: any,   setupOptions?: any, ): StoreDefinition {   let id   let options   \/\/ \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0445\u043e\u0434\u044f\u0449\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c id \u0438 options. \u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 \u0441\u043e\u0440\u0441\u043e\u0432 defineStore   const isSetupStore = typeof setup === 'function'   if (typeof idOrOptions === 'string') {     id = idOrOptions     options = isSetupStore ? setupOptions : setup   } else {     options = idOrOptions     id = idOrOptions.id   }    function useStore(pinia?: Pinia | null | undefined, hot?: StoreGeneric): StoreGeneric {     const currentInstance = getCurrentInstance()     if (currentInstance === null) {       throw new Error('Scoped stores can not be used outside of Vue component')     }      const scopeId = currentInstance.uid \/\/ \u0415\u0441\u043b\u0438 \u043e\u043f\u0430\u0441\u0430\u0435\u0442\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c uid \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0441\u043a\u043e\u0443\u043f\u0430 - \u043c\u043e\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0441\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 id \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430(https:\/\/github.com\/vuejs\/vue\/issues\/5886#issuecomment-308647738) \u0438 \u043e\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e     let piniaId: string | undefined \/\/ Id \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c scoped \u0441\u0442\u043e\u0440\u0430 \u0432 pinia      \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u043b\u0438 \u0440\u0430\u043d\u0435\u0435 \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u0441\u0442\u043e\u0440 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445-\u043f\u0440\u0435\u0434\u043a\u0430\u0445. \u041f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c piniaId scoped \u0441\u0442\u043e\u0440\u0430     if (scopedStoresIdsByScope?.[scopeId]?.[id]) {       piniaId = scopedStoresIdsByScope[scopeId][id]     } else {       piniaId = inject&lt;string>(id)     }      \/\/ \u0415\u0441\u043b\u0438 scoped \u0441\u0442\u043e\u0440 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d(\u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c piniaId) - \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0435\u0433\u043e     if (piniaId &amp;&amp; scopedStoresByPiniaId[piniaId]) {       return scopedStoresByPiniaId[piniaId](pinia, hot)     }      \/\/ \u0415\u0441\u043b\u0438 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e scoped \u0441\u0442\u043e\u0440 \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f(\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c piniaId) - \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0433\u043e     \/\/ piniaId = id \u0441\u0442\u043e\u0440\u0430 + \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043a\u043e\u0443\u043f\u0430     piniaId = `${id}\/${scopeId}`      \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u043e\u0440 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u0432 scopedStoresByPiniaId     if (isSetupStore) {       scopedStoresByPiniaId[piniaId] = defineStore(piniaId, setup, options)     } else {       scopedStoresByPiniaId[piniaId] = defineStore(piniaId, options)     }      \/\/ \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c piniaId \u0438 id \u0441\u0442\u043e\u0440\u0430 \u0432 scopedStoresIdsByScopeId     scopedStoresIdsByScope[scopeId] = scopedStoresIdsByScope[scopeId] ?? {}     scopedStoresIdsByScope[scopeId][id] = piniaId      \/\/ \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0438\u043c \u0435\u0433\u043e piniaId \u0432\u0441\u0435\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c. \u0422\u0430\u043a \u043e\u043d\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f     \/\/ \u0414\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 Options API \u0438 map-\u0444\u0443\u043a\u043d\u0446\u0438\u044f\u043c\u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 provide \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0437\u0432\u043d\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0438\u0436\u0435     \/\/ \u0412\u0430\u0436\u043d\u043e! \u0415\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Composition API - \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 provide     provideInInstance(id, piniaId, currentInstance)      \/\/ \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u0442\u043e\u0440 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0441\u043a\u043e\u0443\u043f\u0430. \u041d\u0435\u0442 \u0441\u043a\u043e\u0443\u043f\u0430 - \u043d\u0435\u0442 scoped \u0441\u0442\u043e\u0440\u0430     onUnmounted(() => {       const pinia = getActivePinia()        if (!pinia || !piniaId) return        delete pinia.state.value[piniaId] \/\/ \u0412\u0437\u044f\u043b \u0438\u0437 api \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 pinia (https:\/\/pinia.vuejs.org\/api\/interfaces\/pinia._StoreWithState.html#Methods-$dispose)       delete scopedStoresByPiniaId[piniaId]       delete scopedStoresIdsByScope[scopeId]     }, currentInstance)      \/\/ \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u043e\u0440     return scopedStoresByPiniaId[piniaId](pinia, hot)   }    useStore.$id = String(Date.now()) \/\/ \u0412 scoped \u0441\u0442\u043e\u0440\u0430\u0445 id \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0437\u0436\u0435, \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u0430. \u041d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438    return useStore }  \/\/ Vue core team \u0443\u0431\u0440\u0430\u043b\u0438 provides \u0438\u0437 \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 ComponentInternalInstance, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0435\u0433\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c. \u0422\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 \u0441\u043e\u0440\u0441\u043e\u0432 ComponentInternalInstance (https:\/\/github.com\/vuejs\/core\/blob\/98f1934811d8c8774cd01d18fa36ea3ec68a0a54\/packages\/runtime-core\/src\/component.ts#L245) type ComponentInternalInstanceWithProvides = ComponentInternalInstance &amp; {provides?: Record&lt;string, unknown>}  \/\/ \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 provide \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0437\u0432\u043d\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430. \u041a\u043e\u0434 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 \u0441\u043e\u0440\u0441\u043e\u0432 provide, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 - currentInstance \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0438\u0437\u0432\u043d\u0435 (https:\/\/github.com\/vuejs\/core\/blob\/98f1934811d8c8774cd01d18fa36ea3ec68a0a54\/packages\/runtime-core\/src\/apiInject.ts#L8) const provideInInstance = &lt;T>(key: InjectionKey&lt;T> | string | number, value: T, instance: ComponentInternalInstanceWithProvides) => {   let provides = instance.provides!    const parentProvides =     instance.parent &amp;&amp; (instance.parent as ComponentInternalInstanceWithProvides).provides   if (parentProvides === provides) {     provides = instance.provides = Object.create(parentProvides)   }    provides[key as string] = value }<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/knerok\/defineScopedStore\/blob\/main\/defineScopedStore.ts\" rel=\"noopener noreferrer nofollow\"><u>\u0412\u0435\u0440\u0441\u0438\u044f \u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432<\/u><\/a><\/p>\n<p>\u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0432 Compotition API, \u0442\u0430\u043a \u0438 \u0432 Options API (\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e \u0441\u00a0 mapState, mapWritableState, mapGetters \u0438 mapActions). \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 defineScopedStore \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0435 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 defineStore.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e provideInInstance. \u0415\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Composition API \u0438\u043b\u0438 \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435\u0441\u044c map-\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0451 \u043d\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 provide.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0437\u0430\u043c\u0435\u043d\u0435 provide<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e currentInstance \u0434\u043b\u044f provide \u0441\u0435\u0442\u0438\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0437\u043e\u0432\u0430 setup-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u0432\u044b\u0437\u043e\u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 map-\u0444\u0443\u043d\u043a\u0446\u0438\u0439(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, mapState) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 <strong>\u043f\u0435\u0440\u0435\u0434<\/strong> \u0432\u044b\u0437\u043e\u0432\u043e\u043c setup. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 map-\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 provide \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 currentInstance. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c currentInstance \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e<\/p>\n<\/div>\n<\/details>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438<\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 scoped-\u0441\u0442\u043e\u0440\u0430 \u0432 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u043c \u043a\u043e\u0434\u0435 YCLIENTS \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043e\u043f\u043b\u0430\u0442\u044b. \u041f\u0435\u0440\u0432\u044b\u043c \u0448\u0430\u0433\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c scoped \u0441\u0442\u043e\u0440\u0430 recordPayment (\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438 \u043d\u0430\u0431\u043e\u0440 \u043e\u043f\u0446\u0438\u0439 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443 \u0441\u0442\u043e\u0440\u0443 Pinia):<\/p>\n<pre><code class=\"typescript\">export const useRecordPaymentStore = defineScopeYcStore('RecordPayment', { \/\/ \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 Pinia \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441   state: () => ({    isPaid: false,  }),  actions: {    setIsPaid(val: boolean) {      this.isPaid = val    },  }, })<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c. \u0422\u043e\u0447\u043a\u043e\u0439 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u043f\u043b\u0430\u0442\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 VPayment.vue. \u0418\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u043c \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442\u0441\u044f scoped \u0441\u0442\u043e\u0440 recordPayment:<\/p>\n<pre><code class=\"typescript\">export default defineComponent({  name: 'VPayment',  setup() {   \u2026    return {    recordPaymentStore: useRecordPaymentStore(),   }  }, }) <\/code><\/pre>\n<p>\u0414\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 VPaymentLoyaltyMethod.vue) \u043c\u043e\u0434\u0443\u043b\u044f VPayment.vue \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u043a \u0441\u0442\u043e\u0440\u0443 recordPayment \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 Pinia \u0441\u0442\u043e\u0440:<\/p>\n<pre><code class=\"typescript\">export default defineComponent({  name: 'VPaymentLoyaltyMethod',  setup() {   ...    return {    recordPaymentStore: useRecordPaymentStore(),   }  }, })<\/code><\/pre>\n<p>\u0421\u0430\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u043f\u043b\u0430\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445-\u0432\u043a\u043b\u0430\u0434\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0443 \u043c\u043e\u0434\u0443\u043b\u044f VPayment \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432\u0441\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043f\u043e \u043a\u043e\u0434\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Pinia, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e. \u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f scoped-\u0441\u0442\u043e\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0443\u0441\u0442\u043e\u044f\u0432\u0448\u0438\u0435\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u044b.<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0442\u043e\u0440\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u0438\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438. \u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043d\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u043e\u0440\u044b, \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u043a \u0441\u043a\u043e\u0443\u043f\u0443 \u0432\u043b\u0435\u0447\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u0440\u044f\u0434 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/h2>\n<ul>\n<li>\n<p>Scoped-\u0441\u0442\u043e\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438\u043b\u0438 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041d\u0435\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u2014 \u043d\u0435\u0442 \u0441\u043a\u043e\u0443\u043f\u0430 \u2014 \u043d\u0435\u0442 \u0441\u0442\u043e\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423\u043c\u0438\u0440\u0430\u0435\u0442 \u0441\u043a\u043e\u0443\u043f (unmount \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0441\u0442\u043e\u0440) \u2014 \u0443\u043c\u0438\u0440\u0430\u0435\u0442 \u0438 \u0441\u0442\u043e\u0440<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 map-\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 mapState, mapWritableState, mapGetters \u0438 mapActions \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u044b\u0439 API \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 (currentInstance.provides). \u041d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 mapStores \u0442\u0430\u043a \u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c<\/p>\n<\/li>\n<\/ul>\n<h2>\u0413\u0434\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e? <\/h2>\n<p>\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u043a\u0435\u0439\u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u2014 \u0441\u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\/\u043c\u043e\u0434\u0443\u043b\u044f \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043c, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:\u00a0<\/p>\n<ul>\n<li>\n<p>\u041a\u0440\u0443\u043f\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043c\u0435\u0436\u0434\u0443 \u0432\u043a\u043b\u0430\u0434\u043a\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 (\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438) \u0438\u043b\u0438 \u0436\u0435 \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0442\u0430\u0431\u0430\u043c\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u041f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043c, \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u043f\u043b\u0430\u0442)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u0431\u043b\u0438\u0446 \u0441\u043e \u0441\u0442\u043e\u0440\u0430\u043c\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 (\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0438 \u043d\u0430 GitHub)<\/p>\n<\/li>\n<li>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440\u044b. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u0441\u0432\u043e\u0451 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u0435, \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434\u044b Pinia \u043f\u043e\u0434\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442 \u043d\u0430\u0441 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0438 \u0443\u0437\u043a\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u0440\u043e\u0432, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0432\u0435\u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043d\u044b\u043c \u0438 \u043c\u043d\u043e\u0433\u043e\u0444\u0443\u043a\u043d\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0438\u0437 Vuex. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0444\u043e\u043a\u0443\u0441 \u0441 \u0438\u0445 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443: \u0435\u0441\u043b\u0438 \u0440\u0430\u043d\u044c\u0448\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0438\u0442\u0430 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0412\u0441\u0451 \u044d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u0443\u0435\u0442\u0441\u044f \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0435\u0439 scoped-\u0441\u0442\u043e\u0440\u043e\u0432 \u2014 \u0443\u0437\u043a\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u043e\u0440\u043e\u0432, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0443 \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<\/p>\n<\/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\/726452\/\"> https:\/\/habr.com\/ru\/articles\/726452\/<\/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<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h2>\n<p>\u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u0432\u0441\u0435 \u0441\u0442\u0435\u0439\u0442-\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Vue (\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e Vuex, \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 Pinia, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430) \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0435 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u043a \u043a\u043e\u0440\u043d\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0418 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e: \u0434\u0443\u043c\u0430\u044e, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0431\u0435\u043d\u0435\u0444\u0438\u0442\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u0431\u0443\u0434\u044c \u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0442\u043e\u0440\u0443 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u043e \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 &#8212; \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 Pinia \u0441\u0442\u043e\u0440\u0430 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0434\u043b\u044f <strong>\u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432<\/strong> \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\/\u043c\u043e\u0434\u0443\u043b\u044f. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>\u041c\u044b \u0432 YCLIENTS \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u043a\u043e\u0433\u0434\u0430 \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0443\u043f\u043d\u044b\u0439 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u043f\u043b\u0430\u0442 \u043c\u0435\u0436\u0434\u0443 \u0432\u043a\u043b\u0430\u0434\u043a\u0430\u043c\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430. \u0412 \u043e\u043a\u043d\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u043c\u043e\u0434\u0443\u043b\u044f, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u0435 \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u0447\u0442\u043e \u0432 \u0440\u0430\u0437\u0440\u0435\u0437 \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0435\u0439 \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0438\u0437 Pinia.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421 \u043f\u043e\u0445\u043e\u0436\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c <a href=\"https:\/\/github.com\/vuejs\/pinia\/discussions\/840\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Pinia \u043d\u0430 GitHub<\/u><\/a>:<\/p>\n<blockquote>\n<p>C\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u0435\u0439\u0441\u044b, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u0442\u0430\u0433\u0440\u0438\u0434\u043e\u0432 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0430\u0442\u0430\u0433\u0440\u0438\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430<\/p>\n<\/blockquote>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u043e frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0435\u0442 \u0435\u0434\u0438\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u043e\u0440\u0430\u043c\u0438. \u0412 \u043d\u0438\u0445 \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e \u0442\u0438\u043f\u0443 \u0438 \u043e\u0431\u044a\u0435\u043c\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0435. \u041c\u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0433\u0434\u0435 \u0434\u0430\u0436\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b\/\u0431\u043b\u043e\u043a\u0438 \u0438\u043c\u0435\u043b\u0438 \u0441\u0432\u043e\u0438 \u0441\u0442\u043e\u0440\u044b. \u0412 \u0446\u0435\u043b\u043e\u043c \u0441\u0442\u043e\u0440\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u2014 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0442\u0440\u0435\u043d\u0434\u043e\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043e\u0442 \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449 (Pinia \u0438 Effector \u044f\u0440\u043a\u0438\u0439 \u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440). \u0412\u0441\u0451 \u044d\u0442\u043e (\u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u0438 \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0438 \u0438 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u043e\u0440\u0430\u043c\u0438) \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439.<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430<\/h3>\n<p>\u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043f\u043e\u0434 \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0435\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e (\u043f\u0440\u0438 \u0441\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u0435\u0439\u043d\u0442\u0435\u043d\u0435\u0440\u043e\u0432 Pinia) \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439 (<a href=\"https:\/\/github.com\/vuejs\/pinia\/discussions\/840?sort=old#discussioncomment-2784643\" rel=\"noopener noreferrer nofollow\"><u>\u0440\u0430\u0437<\/u><\/a> \u0438 <a href=\"https:\/\/github.com\/vuejs\/pinia\/discussions\/840?sort=old#discussioncomment-3210443\" rel=\"noopener noreferrer nofollow\"><u>\u0434\u0432\u0430<\/u><\/a>). \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0445 \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u043e\u0434\u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0442\u043e\u0440\u0443 (\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445 \u0432\u044b\u0448\u0435 \u044d\u0442\u043e tableId \u0438\u043b\u0438 listViewId). \u0411\u0435\u0437 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e Pinia. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 (\u0432\u0435\u0434\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0442\u043e\u0440\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e) \u0432\u0441\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c-\u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c. \u0420\u0435\u0448\u0438\u0432 \u043e\u0434\u043d\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0443\u044e.<\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/ccqgithub\/pinia-di\" rel=\"noopener noreferrer nofollow\"><u>pinia-di<\/u><\/a>. \u0421 \u0435\u0435 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 Pinia. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0435\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u043d\u043e\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0438\u0434\u0435\u0442 \u0432\u0440\u0430\u0437\u0440\u0435\u0437 \u0441 \u0433\u043b\u0430\u0432\u043d\u044b\u043c\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438 \u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438 Pinia: \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c\u044e. \u041a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441.<\/p>\n<h2>\u041c\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h2>\n<p>Pinia \u0441\u0442\u043e\u0440, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u043a \u0441\u043a\u043e\u0443\u043f\u0443 (\u0438\u043b\u0438 <strong>Pinia scoped \u0441\u0442\u043e\u0440<\/strong>). \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043a\u043e\u0443\u043f\u043e\u043c (\u0438\u043b\u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u044c\u044e \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0432\u044b\u043c \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u043e\u0440. \u0412\u0441\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0441\u0442\u043e\u0440\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, <strong>\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0441\u043a\u043e\u0443\u043f\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c<\/strong>, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u043b\u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u043e\u0440\u0430\u043c\u0438. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u0441\u0442\u043e\u0440, \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043c\u043a\u0438 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u043e\u0440 (storeModuleName\/3 \u0438 storeModuleName\/6 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0432\u044b\u0448\u0435), \u0441\u043a\u043e\u0443\u043f\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<p>\u042d\u0442\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0434\u0432\u0443\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0439:<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u0430 (\u0432\u044b\u0437\u043e\u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e defineStore()) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u043a \u0441\u043a\u043e\u0443\u043f\u0443(\u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430)<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u0441\u043a\u043e\u0443\u043f\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f provide\/inject. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c, \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 useStore<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u0437\u044f\u0442 <a href=\"https:\/\/github.com\/vuejs\/pinia\/blob\/v2\/packages\/pinia\/src\/store.ts#L852\" rel=\"noopener noreferrer nofollow\"><u>source \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 defineStore<\/u><\/a>. \u0422\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438\u0437 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0430 (Vue core team \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 as \u0438 any, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0445 \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c). \u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e\u043c\u0443 \u0448\u0430\u0433\u0443:<\/p>\n<pre><code class=\"typescript\">import {defineStore, Pinia, StoreDefinition, StoreGeneric, getActivePinia} from 'pinia' import {inject, getCurrentInstance, onUnmounted, ComponentInternalInstance, InjectionKey} from 'vue'  \/\/ id \u0438 piniaId. \/\/ id - \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 defineScopeYcStore. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, RecordAcquiringPaymentRedesign. \/\/ piniaId - id \u0441\u0442\u043e\u0440\u0430 \u0432 pinia, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0442\u043e\u0440 \u0441\u043a\u043e\u0443\u043f\u0430. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, RecordAcquiringPaymentRedesign\/123124123123123, \u0433\u0434\u0435 123124123123123 - \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043a\u043e\u0443\u043f\u0430(\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0441\u043a\u043e\u0443\u043f\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f uid \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0441\u0442\u043e\u0440) \/\/ \/\/ scopedStoresIdsByScope \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u0432 \u043a\u0430\u043a\u0438\u0445 \u0441\u043a\u043e\u0443\u043f\u0430\u0445(scopeId) \u0438 \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u0440\u044b(id \u0438 piniaId) \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c. \/\/ \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u043e\u0443\u043f\u0430(scopeId) \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c id \u0438 piniaId \u0432\u0441\u0435\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043a\u043e\u0443\u043f\u0435 \u0441\u0442\u043e\u0440\u043e\u0432. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u0432 \u0441 \u043e\u0434\u043d\u0438\u043a\u043e\u0432\u044b\u043c \u0441\u043a\u043e\u0443\u043f\u043e\u043c type ScopedStoresIds = {[id in string]: string} \/\/ {RecordAcquiringPaymentRedesign: 'RecordAcquiringPaymentRedesign\/123124123123123', ...} const scopedStoresIdsByScope: {[scopeId in string]: ScopedStoresIds} = {} \/\/ {123123: {RecordAcquiringPaymentRedesign: 'RecordAcquiringPaymentRedesign\/123124123123123', ...}}  \/\/  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u043d\u0435\u0435 scoped \u0441\u0442\u043e\u0440\u044b. \u041a\u043b\u044e\u0447\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f piniaId, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c - \u0441\u0442\u043e\u0440 const scopedStoresByPiniaId: {[piniaId in string]: ReturnType&lt;typeof defineStore>} = {}  export const defineScopedStore: typeof defineStore = function( \/\/ \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 \u0441\u043e\u0440\u0441\u043e\u0432 defineStore (https:\/\/github.com\/vuejs\/pinia\/blob\/v2\/packages\/pinia\/src\/store.ts#L852)   idOrOptions: any,   setup?: any,   setupOptions?: any, ): StoreDefinition {   let id   let options   \/\/ \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0445\u043e\u0434\u044f\u0449\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c id \u0438 options. \u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 \u0441\u043e\u0440\u0441\u043e\u0432 defineStore   const isSetupStore = typeof setup === 'function'   if (typeof idOrOptions === 'string') {     id = idOrOptions     options = isSetupStore ? setupOptions : setup   } else {     options = idOrOptions     id = idOrOptions.id   }    function useStore(pinia?: Pinia | null | undefined, hot?: StoreGeneric): StoreGeneric {     const currentInstance = getCurrentInstance()     if (currentInstance === null) {       throw new Error('Scoped stores can not be used outside of Vue component')     }      const scopeId = currentInstance.uid \/\/ \u0415\u0441\u043b\u0438 \u043e\u043f\u0430\u0441\u0430\u0435\u0442\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c uid \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0441\u043a\u043e\u0443\u043f\u0430 - \u043c\u043e\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0441\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 id \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430(https:\/\/github.com\/vuejs\/vue\/issues\/5886#issuecomment-308647738) \u0438 \u043e\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e     let piniaId: string | undefined \/\/ Id \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c scoped \u0441\u0442\u043e\u0440\u0430 \u0432 pinia      \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u043b\u0438 \u0440\u0430\u043d\u0435\u0435 \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u0441\u0442\u043e\u0440 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445-\u043f\u0440\u0435\u0434\u043a\u0430\u0445. \u041f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c piniaId scoped \u0441\u0442\u043e\u0440\u0430     if (scopedStoresIdsByScope?.[scopeId]?.[id]) {       piniaId = scopedStoresIdsByScope[scopeId][id]     } else {       piniaId = inject&lt;string>(id)     }      \/\/ \u0415\u0441\u043b\u0438 scoped \u0441\u0442\u043e\u0440 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d(\u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c piniaId) - \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0435\u0433\u043e     if (piniaId &amp;&amp; scopedStoresByPiniaId[piniaId]) {       return scopedStoresByPiniaId[piniaId](pinia, hot)     }      \/\/ \u0415\u0441\u043b\u0438 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e scoped \u0441\u0442\u043e\u0440 \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f(\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c piniaId) - \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0433\u043e     \/\/ piniaId = id \u0441\u0442\u043e\u0440\u0430 + \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043a\u043e\u0443\u043f\u0430     piniaId = `${id}\/${scopeId}`      \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u043e\u0440 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u0432 scopedStoresByPiniaId     if (isSetupStore) {       scopedStoresByPiniaId[piniaId] = defineStore(piniaId, setup, options)     } else {       scopedStoresByPiniaId[piniaId] = defineStore(piniaId, options)     }      \/\/ \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c piniaId \u0438 id \u0441\u0442\u043e\u0440\u0430 \u0432 scopedStoresIdsByScopeId     scopedStoresIdsByScope[scopeId] = scopedStoresIdsByScope[scopeId] ?? {}     scopedStoresIdsByScope[scopeId][id] = piniaId      \/\/ \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0438\u043c \u0435\u0433\u043e piniaId \u0432\u0441\u0435\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c. \u0422\u0430\u043a \u043e\u043d\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f     \/\/ \u0414\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 Options API \u0438 map-\u0444\u0443\u043a\u043d\u0446\u0438\u044f\u043c\u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 provide \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0437\u0432\u043d\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0438\u0436\u0435     \/\/ \u0412\u0430\u0436\u043d\u043e! \u0415\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Composition API - \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 provide     provideInInstance(id, piniaId, currentInstance)      \/\/ \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u0442\u043e\u0440 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0441\u043a\u043e\u0443\u043f\u0430. \u041d\u0435\u0442 \u0441\u043a\u043e\u0443\u043f\u0430 - \u043d\u0435\u0442 scoped \u0441\u0442\u043e\u0440\u0430     onUnmounted(() => {       const pinia = getActivePinia()        if (!pinia || !piniaId) return        delete pinia.state.value[piniaId] \/\/ \u0412\u0437\u044f\u043b \u0438\u0437 api \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 pinia (https:\/\/pinia.vuejs.org\/api\/interfaces\/pinia._StoreWithState.html#Methods-$dispose)       delete scopedStoresByPiniaId[piniaId]       delete scopedStoresIdsByScope[scopeId]     }, currentInstance)      \/\/ \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u043e\u0440     return scopedStoresByPiniaId[piniaId](pinia, hot)   }    useStore.$id = String(Date.now()) \/\/ \u0412 scoped \u0441\u0442\u043e\u0440\u0430\u0445 id \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0437\u0436\u0435, \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u0430. \u041d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438    return useStore }  \/\/ Vue core team \u0443\u0431\u0440\u0430\u043b\u0438 provides \u0438\u0437 \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 ComponentInternalInstance, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0435\u0433\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c. \u0422\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 \u0441\u043e\u0440\u0441\u043e\u0432 ComponentInternalInstance (https:\/\/github.com\/vuejs\/core\/blob\/98f1934811d8c8774cd01d18fa36ea3ec68a0a54\/packages\/runtime-core\/src\/component.ts#L245) type ComponentInternalInstanceWithProvides = ComponentInternalInstance &amp; {provides?: Record&lt;string, unknown>}  \/\/ \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 provide \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0437\u0432\u043d\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430. \u041a\u043e\u0434 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 \u0441\u043e\u0440\u0441\u043e\u0432 provide, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435<\/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-386117","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/386117","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=386117"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/386117\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=386117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=386117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=386117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}