Discover and read the best of Twitter Threads about #es6

Most recents (4)

React Hooks are amazing β†’ but if you're not careful, **performance** can spiral out of control.

Here are the fundamentals for optimum performance. #reactjs #javascript #es6

A thread πŸ‘‡
State, 1/3)

Avoid using multiple setState's for combined data models, especially in async functions as they re-render per setState. Image
State, 2/3)

Instead, combine into a single setState for simple state logic. Image
Read 11 tweets
πŸ”₯πŸ”₯πŸ”₯ The #1 Recursion (Syntax) Twitter Thread

This thread will demonstrate an easy way to write recursive functions

The recursion will so be compared to a for loop for familiarity

Tail Calls and Performance discussed later, Syntax Only!

gist/theme at end πŸ‘‡

#javascript
Step 1: Create your iteration variable(s)

In recursion, it can be easier to set a default value. Pass `i` again when calling `loop` on the `return` line

#javascript #code #dev #es6
Step 2: Add a break condition

Like a for loop, add the break before you write your code. This will prevent infinite looping.

Notice how the for loop is a "continue" and the recursion uses a "break". That means the condition must be flipped for recursion

#javascript #nodejs
Read 10 tweets
πŸ‘οΈπŸ‘οΈWatch me refactor an simple API in four simple steps. (a twitter thread). ⚠️Warning, may contain currying and partial application πŸ˜‰
#javascript #es6
Refactoring Step 1: Eliminate the code `.then(response => response.data)` in each function by extracting this to a function called `getResponseData`.
#javascript #es6
Refactoring Step 2: Eliminate the URLs from each function by extracting this to a function called `createUrl`. The function will create a url based off the category and id.
#javascript #es6
Read 6 tweets
I'm learning @reactjs and it's ecosystem. I will share my learning journey here as a thread.

#LearnInPublic
I will give some context first. I have been working with Java and contributing for Python open source projects like #SerenataDeAmor in the last 3 years. I already knew some frontend but it have changed a lot during this time.
Now I'm coming back to this world though @reactjs because of my new engagement @thoughtworksbr
Read 32 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!