Skip to content

Commit eaff484

Browse files
committed
fix spelling mistakes
1 parent f350e23 commit eaff484

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
standalone-docs/

standalone-docs/basics/Selectors.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ hide_title: true
77

88
# Selectors
99

10-
Selectors are functions that cache their result after they are executed. When you call them again with the same parameters, the result will be returned immediately. This can drastically reduce the performance of web frontends by preventing unnecessary re-rendering of UI components.
10+
Selectors are functions that cache their result after they are executed. When you call them again with the same parameters, the result will be returned immediately. This can drastically improve the performance of web frontends by preventing unnecessary re-rendering of UI components.
1111

1212
Redux-ORM provides a simple API for creating model related selectors. For example, given Movie is a model class registered to `orm`, we can write:
1313

@@ -18,7 +18,7 @@ const movies = createSelector(orm.Movie);
1818

1919
## Argument types
2020

21-
Pass a single primary key, and array of primary keys or nothing as an argument.
21+
Pass a single primary key, an array of primary keys or nothing as an argument.
2222

2323
```js
2424
movies(state); // array of all movies
@@ -37,8 +37,11 @@ moviePublisher(state); // array of each movie's publisher
3737
moviePublisher(state, 1); // the first movie's publisher
3838
moviePublisher(state, [1, 2, 3]); // array of each of the movies with ID 1, 2 and 3
3939
```
40+
4041
### Chaining relationship accessors
42+
4143
For relationships, this works in a chained way as well.
44+
4245
```js
4346
const coverBookAuthors = createSelector(orm.Cover.book.authors);
4447
```
@@ -57,13 +60,16 @@ coverBookAuthors(state, [1, 2, 3]); // [null, null, null]
5760
## Map over collections using `.map()`
5861

5962
Map selectors to model collections:
63+
6064
```js
6165
const bookAuthors = createSelector(orm.Book.authors);
6266
const genreAuthors = createSelector(
6367
orm.Genre.books.map(bookAuthors)
6468
);
6569
```
70+
6671
The following would work as well and is equivalent:
72+
6773
```js
6874
const genreAuthors = createSelector(
6975
orm.Genre.books.map(orm.Book.authors)

0 commit comments

Comments
 (0)