This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ id: 1, likes: 13, text: 'Lets code in Reactjs for all day long!' }, | |
{ id: 2, likes: 87, text: 'Software Developer is a good choice to your life!' }, | |
{ id: 3, likes: 51, text: 'Make your code readability.' }, | |
{ id: 4, likes: 32, text: 'Open Source Software is the best thing for the developers learn more and more.' }, | |
] | |
// -> Remove the likes property -> | |
[ | |
{ id: 1, text: 'Lets code in Reactjs for all day long!' }, | |
{ id: 2, text: 'Software Developer is a good choice to your life!' }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const localStorageKey = '__bookshelf_token__' | |
function client(endpoint, {body, ...customConfig} = {}) { | |
const token = window.localStorage.getItem(localStorageKey) | |
const headers = {'content-type': 'application/json'} | |
if (token) { | |
headers.Authorization = `Bearer ${token}` | |
} | |
const config = { | |
method: body ? 'POST' : 'GET', | |
...customConfig, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
function Counter(props) { | |
const { counter, setCounter } = props; | |
return ( | |
<div> | |
<h1>Functional Component Example for Counter</h1> | |
<p>We clicked {counter} times</p> | |
<button onClick={() => setCounter(counter + 1)}>Increase counter</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi! This works for me. | |
Just install the font that you want. | |
Set "editor.fontLigatures": true and "editor.fontLigatures": true in settings.json on VS Code. | |
Restart your VS Code. | |
Be happy! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const poll = ({ fn, validate, interval, maxAttempts }) => { | |
console.log('Start poll...'); | |
let attempts = 0; | |
const executePoll = async (resolve, reject) => { | |
console.log('- poll'); | |
const result = await fn(); | |
attempts++; | |
if (validate(result)) { |
OlderNewer