{"id":14158,"date":"2021-08-29T12:00:32","date_gmt":"2021-08-29T03:00:32","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=14158"},"modified":"2023-05-28T08:43:56","modified_gmt":"2023-05-27T23:43:56","slug":"%e3%80%90%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0%e3%80%91%e3%80%8c%e5%89%af%e4%bd%9c%e7%94%a8%e3%80%8d%e3%81%ae%e4%be%8b","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=14158","title":{"rendered":"\u3010\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3011\u300c\u526f\u4f5c\u7528\u300d\u3001\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u958b\u767a\u3067\u30a4\u30df\u30e5\u30fc\u30bf\u30d6\u30eb\u304c\u8981\u6c42\u3055\u308c\u308b\u80cc\u666f\u306a\u3069"},"content":{"rendered":"<h2>\u526f\u4f5c\u7528\u306e\u4f8b<\/h2>\n<h3>\u5b9f\u884c\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u306b\u3088\u3063\u3066\u4f55\u306e\u5024\u304c\u8fd4\u3063\u3066\u304f\u308b\u304b\u308f\u304b\u3089\u306a\u3044\u51e6\u7406\u304c\u8a18\u8ff0\u3057\u3066\u3042\u308b\u3002<\/h3>\n<ul>\n<li>\u6642\u523b\u3092\u53d6\u5f97\u3059\u308b\u51e6\u7406<\/li>\n<li>\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f<\/li>\n<li>DB\u8aad\u307f\u8fbc\u307f<\/li>\n<li>\u74b0\u5883\u5909\u6570\u306e\u53c2\u7167<\/li>\n<li>\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u53c2\u7167<\/li>\n<li>\u4e71\u6570\u751f\u6210<\/li>\n<li>JavaScript\u306econsole.log\uff08\u306a\u305c\u526f\u4f5c\u7528\u304c\u3042\u308b\u304b\u306f\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3002\uff09<\/li>\n<\/ul>\n<h3>class\u3067\u3042\u308c\u3070\u4fdd\u6301\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092\u5916\u90e8\u304b\u3089\u3044\u3064\u3067\u3082\u5909\u66f4\u3067\u304d\u308b\u3002\uff08\u30bb\u30c3\u30bf\u30fc\u30e1\u30bd\u30c3\u30c9\u306a\u3069\uff09<\/h3>\n<h2>\u526f\u4f5c\u7528\u306f\u5168\u3066\u6392\u9664\u3059\u308c\u3070\u826f\u3044\u306e\u304b\uff1f<\/h2>\n<p>\u3067\u306f\u3001\u753b\u9762\u5165\u529b\u3084\u30d5\u30a1\u30a4\u30eb\u5165\u529b\u306a\u3069\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u306f\u72b6\u614b\u3092\u6301\u305f\u305b\u308b\u3053\u3068\u304c\u4e0d\u53ef\u6b20\u306a\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u601d\u60f3\u304c\u91cd\u8981\u306b\u306a\u308b\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u300c\u526f\u4f5c\u7528\u3092\u6301\u305f\u306a\u3044\u90e8\u5206\u300d\uff08\u7d14\u7c8b\u95a2\u6570<span style=\"color: #ff0000;\">\uff09<\/span><\/strong><strong>\u3068\u300c\u526f\u4f5c\u7528\u3092\u6301\u3064\u90e8\u5206\u300d\u3092\u5206\u96e2\u3059\u308b\u3053\u3068<\/strong><\/span>\u304c\u91cd\u8981\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u526f\u4f5c\u7528\u3092\u6301\u3064\u95a2\u6570\u304b\u3089\u526f\u4f5c\u7528\u3092\u6301\u305f\u306a\u3044\u95a2\u6570\u3092\u547c\u3073\u51fa\u3057\u3066\u826f\u3044<\/strong><\/span>\u304c\u3001\u9006\u306b<span style=\"color: #ff0000;\"><strong>\u526f\u4f5c\u7528\u3092\u6301\u305f\u306a\u3044\u95a2\u6570\u304b\u3089\u526f\u4f5c\u7528\u3092\u6301\u3064\u95a2\u6570\u3092\u547c\u3073\u51fa\u3057\u3066\u306f\u3044\u3051\u306a\u3044\u3002<\/strong><\/span><\/p>\n<h4>\u526f\u4f5c\u7528\u3092\u6301\u305f\u306a\u3044\u95a2\u6570<\/h4>\n<p>\u5f15\u6570\u306b\u65e5\u4ed8\u3092\u53d7\u3051\u53d6\u3063\u3066\u51e6\u7406\u3059\u308b\u95a2\u6570<\/p>\n<h4>\u526f\u4f5c\u7528\u3092\u6301\u3064\u95a2\u6570<\/h4>\n<p>\u95a2\u6570\u306e\u5185\u90e8\u3067\u65e5\u4ed8\u3092\u751f\u6210\u3057\u3066\u51e6\u7406\u3059\u308b\u95a2\u6570<\/p>\n<h2>\u526f\u4f5c\u7528\u306e\u5bfe\u7b56<\/h2>\n<h3>\u5b9f\u884c\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u306b\u3088\u3063\u3066\u4f55\u306e\u7d50\u679c\u304c\u8fd4\u3063\u3066\u304f\u308b\u304b\u308f\u304b\u3089\u306a\u3044\u3002<\/h3>\n<p>\u5916\u90e8\u304b\u3089\u5024\u3092\u3082\u3089\u3046\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n<h2>\u526f\u4f5c\u7528\u304c\u3042\u308b\u30bd\u30fc\u30b9\u306e\u30c7\u30e1\u30ea\u30c3\u30c8<\/h2>\n<h3>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u3065\u3089\u304f\u306a\u308b\u3002<\/h3>\n<p>\u5b9f\u884c\u3059\u308b\u305f\u3073\u306b\u7d50\u679c\u304c\u5909\u308f\u308b\u306e\u3067\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306f\u66f8\u3051\u306a\u3044\u3067\u3059\u3002<\/p>\n<h2>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306f\u306a\u305c\u30a4\u30df\u30e5\u30fc\u30bf\u30d6\u30eb\u304c\u826f\u3044\u306e\u304b\uff1f<\/h2>\n<h3>\u305d\u3082\u305d\u3082\u30a4\u30df\u30e5\u30fc\u30bf\u30d6\u30eb\u3068\u306f\uff1f<\/h3>\n<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u914d\u5217\u306e\u72b6\u614b\u304c\u5909\u308f\u3089\u306a\u3044\u3053\u3068\u3067\u3059\u3002<\/p>\n<h3>\u306a\u305c\u3001\u6628\u4eca\u306e\u30d5\u30ed\u30f3\u30c8\u958b\u767a\u3067\u306f\u30a4\u30df\u30e5\u30fc\u30bf\u30d6\u30eb\u306a\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u308b\u304b<\/h3>\n<h4>\u52d5\u7684\u306b\u753b\u9762\u3092\u518d\u63cf\u753b\u3055\u305b\u308b\u305f\u3081<\/h4>\n<p>\u6628\u4eca\u306eWeb\u958b\u767a\u3067\u306f\u3001\u6642\u9593\u7d4c\u904e\u3084\u30e6\u30fc\u30b6\u30fc\u306e\u30a4\u30f3\u30bf\u30e9\u30af\u30b7\u30e7\u30f3\u306b\u3088\u3063\u3066\u72b6\u614b\u3092\u5909\u5316\u3055\u305b\u308b\u3053\u3068\u3067\u30b7\u30fc\u30e0\u30ec\u30b9\uff08\u9014\u5207\u308c\u306a\u304f\uff09\u306b\u63cf\u753b\u3092\u5909\u5316\u3055\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<p>JavaScript\u306f\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3001\u30af\u30e9\u30b9\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5024\u3092\u5909\u66f4\u3057\u305f\u5834\u5408\u306f\u3001\u305d\u306e\u5909\u66f4\u306f\u5909\u66f4\u5143\u306e\u5909\u6570\u3092\u7834\u58ca\u7684\u306a\u5f71\u97ff\u3092\u53ca\u307c\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067\u306f\u52d5\u7684\u306b\u753b\u9762\u3092\u63cf\u753b\u3059\u308b\u306b\u306f\u3001\u52d5\u7684\u306b\u753b\u9762\u3092\u63cf\u753b\u3059\u308b\u306b\u306f\u72b6\u614b\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u526f\u4f5c\u7528\u306e\u5f71\u97ff\u304c\u53ca\u3073\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001React\u3084Redux\u306estate\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5dee\u5206\u3067\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304a\u308a\u3001<span style=\"color: #ff0000;\"><strong>\u30df\u30e5\u30fc\u30bf\u30d6\u30eb\u306b\u5024\u3092\u66f4\u65b0\u3057\u3066\u3057\u307e\u3046\u3068\u5909\u66f4\u524d\u306e\u5024\u3082\u66f8\u304d\u5909\u308f\u3063\u3066\u3057\u307e\u3044\u540c\u4e00\u3068\u307f\u306a\u3055\u308c\u3066\u518d\u63cf\u753b\u3055\u308c\u306a\u3044\u305f\u3081<\/strong><\/span>\u3067\u3059\u3002\uff08shallow equality checking\uff08\u53c2\u7167\u5143\u306e\u30e1\u30e2\u30ea\u306e\u756a\u5730\u304c\u5909\u308f\u3063\u3066\u3044\u308b\u304b\u3092\u898b\u3066\u3044\u308b\u3002\u4e2d\u8eab\u304c\u5909\u308f\u3063\u3066\u3082\u53c2\u7167\u5143\u304c\u540c\u3058\u3060\u3068\u5909\u5316\u304c\u306a\u3044\u3068\u307f\u306a\u3055\u308c\u308b\u3002\uff09\u3068\u3044\u3046\u4ed5\u7d44\u307f\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3059\u3002\uff09<\/p>\n<h4>\u4e88\u6e2c\u3067\u304d\u306a\u3044state\u306e\u66f4\u65b0\u3092\u59a8\u3052\u3089\u308c\u308b\u3002<\/h4>\n<p>\u3044\u3064\u3067\u3082\u8ab0\u3067\u3082state\u3092\u66f4\u65b0\u3067\u304d\u3066\u3057\u307e\u3046\u3068\u73fe\u5728\u306e\u72b6\u614b\u304c\u5206\u304b\u3089\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u3002\u3057\u304b\u3082\u3001\u30d0\u30b0\u3067\u306f\u306a\u3044\u304b\u3089\u30a8\u30e9\u30fc\u3082\u51fa\u306a\u3044\u306e\u3067\u8ab0\u304c\u66f4\u65b0\u3057\u305f\u304b\u3092\u8ffd\u3046\u3053\u3068\u3082\u96e3\u3057\u3044\u3067\u3059\u3002<\/p>\n<h4>\u30d5\u30ed\u30f3\u30c8\u306f\u30c7\u30fc\u30bf\u6570\u304c\u5c11\u306a\u3044\u306e\u3067\u3001\u8907\u88fd\u30b3\u30b9\u30c8\u304c\u4f4e\u3044<\/h4>\n<p>\u30d5\u30ed\u30f3\u30c8\u306f<span style=\"color: #ff0000;\"><strong>\u63cf\u753b\u30b3\u30b9\u30c8\u306e\u90fd\u5408\u4e0a\u30c7\u30fc\u30bf\u6570\u304c\u5c11\u306a\u304f\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/strong><\/span>\u306a\u306e\u3067\u3001\u4eee\u306b\u30a4\u30df\u30e5\u30fc\u30bf\u30d6\u30eb\u3092\u4fdd\u3064\u305f\u3081\u306b\u8907\u88fd\u3057\u305f\u3068\u3057\u3066\u3082\u5927\u3057\u305f\u30b3\u30b9\u30c8\u306b\u306f\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<h3>\u5bfe\u7b56<\/h3>\n<p>\u30b9\u30d7\u30ec\u30c3\u30c8\u69cb\u6587\u3092\u4f7f\u3063\u3066\u5024\u3092\u30a4\u30df\u30e5\u30fc\u30bf\u30d6\u30eb\u306b\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u65b0\u3057\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">const objA = {a: 10 };\r\nlet objB = { ...objA, b: 20 };\r\nconsole.log(objA); \/\/ -&gt; { a: 10 }\r\nconsole.log(objB); \/\/ -&gt; { a:10,b: 20 }<\/pre>\n<h3>\u305f\u3060\u3057\u3001\u30a4\u30df\u30e5\u30fc\u30bf\u30d6\u30eb\u306b\u3057\u3059\u304e\u308b\u3068\u30bd\u30fc\u30b9\u304c\u5197\u9577\u306b\u306a\u308b\u3002<\/h3>\n<p>\u305f\u3060\u3001\u30a4\u30df\u30e5\u30fc\u30bf\u30d6\u30eb\u3067\u3042\u308b\u3053\u3068\u3092\u5b88\u308a\u3059\u304e\u308b\u3068<span style=\"color: #ff0000;\"><strong>\u300c...\u300d<\/strong><\/span>\u304c\u5897\u3048\u3059\u304e\u3066\u30bd\u30fc\u30b9\u304c\u8aad\u307f\u3065\u3089\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>Immer\u3092\u4f7f\u3046\u3002<\/h4>\n<p>Immer\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u306e\u304c\u826f\u3044\u3067\u3059\u3002\u6982\u8981\u3060\u3051\u8aac\u660e\u3059\u308b\u3068\u3001\u7834\u58ca\u7684\u306b\u601d\u3044\u3063\u304d\u308a\u66f8\u3044\u305f\u3068\u3057\u3066\u3082\u3053\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u666e\u901a\u306b\u30a4\u30df\u30e5\u30fc\u30bf\u30d6\u30eb\u306a\u30b3\u30fc\u30c9\u306b\u52dd\u624b\u306b\u5909\u63db\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u3046\u3057\u305f\u30b9\u30d7\u30ec\u30c3\u30c8\u69cb\u6587\u3092\u6392\u9664\u3057\u3066\u30b9\u30c3\u30ad\u30ea\u66f8\u3053\u3046\u3068\u3044\u3046\u306e\u3092\u76ee\u6307\u3057\u305f\u306e\u304c\u3001immer\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u526f\u4f5c\u7528\u306e\u4f8b \u5b9f\u884c\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u306b\u3088\u3063\u3066\u4f55\u306e\u5024\u304c\u8fd4\u3063\u3066\u304f\u308b\u304b\u308f\u304b\u3089\u306a\u3044\u51e6\u7406\u304c\u8a18\u8ff0\u3057\u3066\u3042\u308b\u3002 \u6642\u523b\u3092\u53d6\u5f97\u3059\u308b\u51e6\u7406 \u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f DB\u8aad\u307f\u8fbc\u307f \u74b0\u5883\u5909\u6570\u306e\u53c2\u7167 \u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u53c2\u7167 \u4e71\u6570\u751f\u6210 JavaScript\u306econso [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/14158"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14158"}],"version-history":[{"count":9,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/14158\/revisions"}],"predecessor-version":[{"id":20787,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/14158\/revisions\/20787"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14158"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}