Telegram Group & Telegram Channel
Управление типами кортежей

Предположим, у нас есть функция, которая возвращает кортеж, например, пользовательский хук:


function useBool(initialValue = false) {
const [state, setState] = React.useState(initialValue)

const handlers = React.useMemo(
() => ({
on: () => setState(true),
off: () => setState(false),
toggle: () => setState(s => !s),
reset: () => setState(initialValue),
}),
[initialValue],
)

return [state, handlers]
}

const result = useBool()



https://kyleshevlin.com/wrangling-tuple-types/

✍️ @React_lib



tg-me.com/React_lib/605
Create:
Last Update:

Управление типами кортежей

Предположим, у нас есть функция, которая возвращает кортеж, например, пользовательский хук:


function useBool(initialValue = false) {
const [state, setState] = React.useState(initialValue)

const handlers = React.useMemo(
() => ({
on: () => setState(true),
off: () => setState(false),
toggle: () => setState(s => !s),
reset: () => setState(initialValue),
}),
[initialValue],
)

return [state, handlers]
}

const result = useBool()



https://kyleshevlin.com/wrangling-tuple-types/

✍️ @React_lib

BY React


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/React_lib/605

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

If riding a bucking bronco is your idea of fun, you’re going to love what the stock market has in store. Consider this past week’s ride a preview.The week’s action didn’t look like much, if you didn’t know better. The Dow Jones Industrial Average rose 213.12 points or 0.6%, while the S&P 500 advanced 0.5%, and the Nasdaq Composite ended little changed.

What is Secret Chats of Telegram

Secret Chats are one of the service’s additional security features; it allows messages to be sent with client-to-client encryption. This setup means that, unlike regular messages, these secret messages can only be accessed from the device’s that initiated and accepted the chat. Additionally, Telegram notes that secret chats leave no trace on the company’s services and offer a self-destruct timer.

telegram from fr


Telegram React
FROM USA