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: standalone-docs/basics/Selectors.md
+8-2
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ hide_title: true
7
7
8
8
# Selectors
9
9
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.
11
11
12
12
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:
13
13
@@ -18,7 +18,7 @@ const movies = createSelector(orm.Movie);
18
18
19
19
## Argument types
20
20
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.
22
22
23
23
```js
24
24
movies(state); // array of all movies
@@ -37,8 +37,11 @@ moviePublisher(state); // array of each movie's publisher
37
37
moviePublisher(state, 1); // the first movie's publisher
38
38
moviePublisher(state, [1, 2, 3]); // array of each of the movies with ID 1, 2 and 3
39
39
```
40
+
40
41
### Chaining relationship accessors
42
+
41
43
For relationships, this works in a chained way as well.
0 commit comments