From 4e04b74966f1656ef1d5b684bcb7bea7ddf6f685 Mon Sep 17 00:00:00 2001 From: Rovshan Badirkhanov Date: Tue, 21 Oct 2025 11:41:12 +0400 Subject: [PATCH] Fix spacings --- .../NormalizingStateShape.md | 143 +++++++++--------- 1 file changed, 74 insertions(+), 69 deletions(-) diff --git a/docs/usage/structuring-reducers/NormalizingStateShape.md b/docs/usage/structuring-reducers/NormalizingStateShape.md index f295189a9e..d9645ec7b2 100644 --- a/docs/usage/structuring-reducers/NormalizingStateShape.md +++ b/docs/usage/structuring-reducers/NormalizingStateShape.md @@ -74,69 +74,69 @@ An example of a normalized state structure for the blog example above might look ```js { - posts : { - byId : { - "post1" : { - id : "post1", - author : "user1", - body : "......", - comments : ["comment1", "comment2"] + posts: { + byId: { + post1: { + id: "post1", + author: "user1", + body: "......", + comments: ["comment1", "comment2"] }, - "post2" : { - id : "post2", - author : "user2", - body : "......", - comments : ["comment3", "comment4", "comment5"] + post2: { + id: "post2", + author: "user2", + body: "......", + comments: ["comment3", "comment4", "comment5"] } }, - allIds : ["post1", "post2"] + allIds: ["post1", "post2"] }, - comments : { - byId : { - "comment1" : { - id : "comment1", - author : "user2", - comment : ".....", + comments: { + byId: { + comment1: { + id: "comment1", + author: "user2", + comment: "....." }, - "comment2" : { - id : "comment2", - author : "user3", - comment : ".....", + comment2: { + id: "comment2", + author: "user3", + comment: "....." }, - "comment3" : { - id : "comment3", - author : "user3", - comment : ".....", + comment3: { + id: "comment3", + author: "user3", + comment: "....." }, - "comment4" : { - id : "comment4", - author : "user1", - comment : ".....", - }, - "comment5" : { - id : "comment5", - author : "user3", - comment : ".....", + comment4: { + id: "comment4", + author: "user1", + comment: "....." }, + comment5: { + id: "comment5", + author: "user3", + comment: "....." + } }, - allIds : ["comment1", "comment2", "comment3", "comment4", "comment5"] + allIds: ["comment1", "comment2", "comment3", "comment4", "comment5"] }, - users : { - byId : { - "user1" : { - username : "user1", - name : "User 1", + users: { + byId: { + user1: { + username: "user1", + name: "User 1" }, - "user2" : { - username : "user2", - name : "User 2", + user2: { + username: "user2", + name: "User 2" }, - "user3" : { - username : "user3", - name : "User 3", + user3: { + username: "user3", + name: "User 3" } }, - allIds : ["user1", "user2", "user3"] + allIds: ["user1", "user2", "user3"] } } ``` @@ -158,11 +158,11 @@ A typical application will likely have a mixture of relational data and non-rela { simpleDomainData1: {....}, simpleDomainData2: {....}, - entities : { + entities: { entityType1 : {....}, entityType2 : {....} }, - ui : { + ui: { uiSection1 : {....}, uiSection2 : {....} } @@ -178,28 +178,33 @@ Because we're treating a portion of our Redux store as a "database", many of the ```js { entities: { - authors : { byId : {}, allIds : [] }, - books : { byId : {}, allIds : [] }, - authorBook : { - byId : { - 1 : { - id : 1, - authorId : 5, - bookId : 22 + authors: { + byId: {}, + allIds: [] + }, + books: { + byId: {}, + allIds: [] + }, + authorBook: { + byId: { + 1: { + id: 1, + authorId: 5, + bookId: 22 }, - 2 : { - id : 2, - authorId : 5, - bookId : 15, + 2: { + id: 2, + authorId: 5, + bookId: 15 }, - 3 : { - id : 3, - authorId : 42, - bookId : 12 + 3: { + id: 3, + authorId: 42, + bookId: 12 } }, - allIds : [1, 2, 3] - + allIds: [1, 2, 3] } } }