From 65b9d087af35ed187a10081e329237e06d84ab11 Mon Sep 17 00:00:00 2001 From: bsky Date: Tue, 28 May 2019 23:37:02 +0900 Subject: [PATCH] docs: fix example code formatting (#373) --- readme.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/readme.md b/readme.md index 2c0cc46e..11398798 100644 --- a/readme.md +++ b/readme.md @@ -199,17 +199,16 @@ console.dir([{}, {}, {}].map(mapper)) This mechanism can also nicely be leveraged to further simplify our example reducer: ```javascript -import produce from 'immer' +import produce from "immer" const byId = produce((draft, action) => { - switch (action.type) { - case RECEIVE_PRODUCTS: - action.products.forEach(product => { - draft[product.id] = product - }) - return - }) - } + switch (action.type) { + case RECEIVE_PRODUCTS: + action.products.forEach(product => { + draft[product.id] = product + }) + return + } }) ```