mirror of
https://github.com/kettanaito/naming-cheatsheet.git
synced 2025-08-09 06:45:00 +02:00
Update README.md
This commit is contained in:
committed by
GitHub
parent
bcfe4ff4d8
commit
e1cf9e1948
10
README.md
10
README.md
@ -92,13 +92,13 @@ function fetchPosts(postCount) {
|
|||||||
#### `set`
|
#### `set`
|
||||||
Declaratively set `variableA` with `valueA` to `valueB`.
|
Declaratively set `variableA` with `valueA` to `valueB`.
|
||||||
```js
|
```js
|
||||||
function Component() {
|
const fruits = 0;
|
||||||
this.state = { fruits: 0 };
|
|
||||||
|
|
||||||
function setFruits(nextFruits) {
|
function setFruits(nextFruits) {
|
||||||
this.state.fruits = nextFruits;
|
fruits = nextFruits;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setFruits(5); // fruits === 5
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `reset`
|
#### `reset`
|
||||||
|
Reference in New Issue
Block a user