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
Memoize actionCreator and returns a memoized actionCreator. When dispatch action that created by memorized actionCreator, it will returns a Promise.
135
135
136
136
#### Arguments
137
137
138
-
-`opts`_Object_
138
+
-`opts`_Object | number <optional>_
139
139
-`ttl`_Number|Function_: The time to live for cached action creator. When `ttl` is a function, `getState` will be passed as argument, and it must returns a number.
140
140
-`enabled`_Boolean|Function_: Whether use memorized action creator or not. When `false`, cache will be ignored and the result of original action creator will be dispatched without caching. When `enabled` is a function, `getState` will be passed argument, and it must returns a boolean.
141
141
-`isEqual`: arguments of action creator will be used as the map cache key. It uses lodash.isEqual to find the existed cached action creator. You can customize this function.
142
+
- If `opts` is a number, the numbrer specifies the ttl.
142
143
143
144
#### Returns
144
145
145
146
- (Promise): will be resolved with the result of original actionCreator.
Create a redux [middleware](http://redux.js.org/docs/advanced/Middleware.html).
150
151
151
152
#### Arguments
152
153
153
-
-`opts`_Object_
154
-
-disableTTL _Boolean_: The default value is `true` on server and `false` on browser. By default, cached action creator will not be evicted by setTimeout with TTL on server in order to prevent memory leak. You can enable it for test purpose.
155
-
-globalOptions _Object_: Default opts for memorize().
- There is another options `disableTTL`. The default value is `true` on server and `false` on browser. By default, cached action creator will not be evicted by setTimeout with TTL on server in order to prevent memory leak. You can enable it for test purpose.
Copy file name to clipboardExpand all lines: package.json
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "redux-memoize",
3
-
"version": "1.1.0",
3
+
"version": "2.0.0",
4
4
"description": "Memoize action creator for redux, and let you dispatch common/thunk/promise/async action whenever you want to, without worrying about duplication",
0 commit comments