You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,15 +113,15 @@ In other words, **high context emphasizes the meaning of a variable**.
113
113
114
114
The verb part of your function name. The most important part responsible for describing what the function *does*.
115
115
116
-
####`get`
116
+
### `get`
117
117
Accesses data immediately (i.e. shorthand getter of internal data).
118
118
```js
119
119
functiongetFruitsCount() {
120
120
returnthis.fruits.length;
121
121
}
122
122
```
123
123
124
-
####`set`
124
+
### `set`
125
125
Declaratively sets a variable with value `A` to value `B`.
126
126
127
127
```js
@@ -135,7 +135,7 @@ setFruits(5)
135
135
console.log(fruits) // 5
136
136
```
137
137
138
-
####`reset`
138
+
### `reset`
139
139
Sets a variable back to its initial value or state.
140
140
141
141
```js
@@ -152,15 +152,15 @@ resetFruits()
152
152
console.log(fruits) // 5
153
153
```
154
154
155
-
####`fetch`
155
+
### `fetch`
156
156
Requests for a data, which takes time (i.e. async request).
157
157
```js
158
158
functionfetchPosts(postCount) {
159
159
returnfetch('https://api.dev/posts', { ... })
160
160
}
161
161
```
162
162
163
-
####`remove`
163
+
### `remove`
164
164
Removes something *from* somewhere.
165
165
166
166
For example, if you have a collection of selected filters on a search page, removing one of them from the collection is `removeFilter`, **not**`deleteFilter` (and this is how you would naturally say it in English as well):
@@ -179,7 +179,7 @@ function removeFilter(filterName) {
179
179
}
180
180
```
181
181
182
-
####`delete`
182
+
### `delete`
183
183
Completely erazes something from the realms of existance.
184
184
185
185
Imagine you are a content editor, and there is that notorious post you wish to get rid of. Once you clicked a shiny "Delete post" button, the CMS performed a `deletePost` action, **not**`removePost`.
@@ -190,7 +190,7 @@ function deletePost(id) {
190
190
}
191
191
```
192
192
193
-
####`compose`
193
+
### `compose`
194
194
Creates a new data from the existing one. Mostly applicable to strings or objects.
195
195
196
196
```js
@@ -199,7 +199,7 @@ function composePageUrl(pageName, pageId) {
199
199
}
200
200
```
201
201
202
-
####`handle`
202
+
### `handle`
203
203
Handles a dedicated action. Often used in naming the callback methods.
0 commit comments