Skip to content

Commit 848b802

Browse files
committed
Improves description of actions and prefixes
1 parent 627a35b commit 848b802

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ removeFilter('price', selectedFilters)
180180
> See also [delete](#delete).
181181
182182
### `delete`
183-
Completely erazes something from the realms of existance.
183+
Completely erazes something from the realms of existence.
184184

185185
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`.
186186

@@ -193,7 +193,7 @@ function deletePost(id) {
193193
> See also [remove](#remove).
194194
195195
### `compose`
196-
Creates a new data from the existing one. Mostly applicable to strings or objects.
196+
Creates a new data from the existing one. Mostly applicable to strings, objects, or functions.
197197

198198
```js
199199
function composePageUrl(pageName, pageId) {
@@ -204,11 +204,10 @@ function composePageUrl(pageName, pageId) {
204204
> See also [get](#get).
205205
206206
### `handle`
207-
Handles a dedicated action. Often used in naming the callback methods.
207+
Handles an action. Often used when naming a callback method.
208208

209209
```js
210-
function handleLinkClick(event) {
211-
event.preventDefault()
210+
function handleLinkClick() {
212211
console.log('Clicked a link!')
213212
}
214213

@@ -235,16 +234,16 @@ function getRecentPosts(posts) {
235234
}
236235
```
237236

238-
> Note that language-specific assumptions may allow to ommit the context in some cases. For example, in JavaScript it is common that `filter` operates on Array. Adding explicit `filterArray` would be unnecessary.
237+
> Some language-specific assumptions may allow to ommit the context. For example, in JavaScript it is common that `filter` operates on Array. Adding explicit `filterArray` would be unnecessary.
239238
240239
---
241240

242241
## Prefixes
243242

244-
Prefix enhances the meaning of a variable.
243+
Prefix enhances the meaning of a variable. It is rarely used in function names.
245244

246245
### `is`
247-
Describes certain characteristic or state of the current context (returns `boolean`).
246+
Describes a characteristic or state of the current context (usually `boolean`).
248247

249248
```js
250249
const color = 'blue'
@@ -257,7 +256,7 @@ if (isBlue && isPresent) {
257256
```
258257

259258
### `has`
260-
Describes whether the current context possesses a certain value or state (returns `boolean`).
259+
Describes whether the current context possesses a certain value or state (usually `boolean`).
261260

262261
```js
263262
/* Bad */
@@ -269,7 +268,7 @@ const hasProducts = (productsCount > 0)
269268
```
270269

271270
### `should`
272-
Reflects a positive conditional statement (returns `Boolean`) tightly coupled with a certain action.
271+
Reflects a positive conditional statement (usually `boolean`) coupled with a certain action.
273272

274273
```js
275274
function shouldUpdateUrl(url, expectedUrl) {
@@ -278,7 +277,7 @@ function shouldUpdateUrl(url, expectedUrl) {
278277
```
279278

280279
### `min`/`max`
281-
Represent minimum or maximum value. Useful for describing boundaries or limits.
280+
Represent minimum or maximum value. Used when describing boundaries or limits.
282281

283282
```js
284283
function PostsList() {
@@ -288,7 +287,7 @@ function PostsList() {
288287
```
289288

290289
### `prev`/`next`
291-
Indicate the previous and the next state of a variable in the current context. Useful for describing state transitions.
290+
Indicate the previous or the next state of a variable in the current context. Used when describing state transitions.
292291

293292
```jsx
294293
function fetchPosts() {

0 commit comments

Comments
 (0)