File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ return <Button disabled={!isEnabled} />
8282
8383/* Good */
8484const isDisabled = (itemsCount <= 3 )
85- return < Button disabled= {isDisabled} / > )
85+ return < Button disabled= {isDisabled} / >
8686```
8787
8888---
@@ -280,9 +280,12 @@ function shouldUpdateUrl(url, expectedUrl) {
280280Represent minimum or maximum value. Used when describing boundaries or limits.
281281
282282``` js
283- function PostsList () {
284- this .minPosts = 3
285- this .maxPosts = 10
283+ /**
284+ * Renders random amount of posts within
285+ * the given min/max boundaries.
286+ */
287+ function renderPosts (posts , minPosts , maxPosts ) {
288+ return posts .slice (0 , randomBetween (minPosts, maxPosts))
286289}
287290```
288291
@@ -294,8 +297,8 @@ function fetchPosts() {
294297 const prevPosts = this .state .posts
295298
296299 const fetchedPosts = fetch (' ...' )
297- const nextPosts = prevPosts . merge ( fetchedPosts)
300+ const nextPosts = concat (prevPosts, fetchedPosts)
298301
299- return this .setState ({ posts: nextPosts })
302+ this .setState ({ posts: nextPosts })
300303}
301304```
You can’t perform that action at this time.
0 commit comments