Skip to content

Commit 565b72a

Browse files
authored
Merge pull request #228 from axos88/patch-1
Clarify the necessity of a reviver
2 parents f40cc0a + c3af673 commit 565b72a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ You can learn more on the `ioredis` package [here](https://github.com/luin/iored
138138
## Using a custom reviver
139139

140140
By default, Javascript objects are serialized using the `JSON.stringify` and `JSON.parse` methods.
141-
For handling custom objects, you may pass your own reviver function to `JSON.parse`.
141+
This means that not all objects - such as Date or Regexp objects - will deserialize correctly without a custom reviver, that work out of the box with the default in-memory implementation.
142+
For handling such objects, you may pass your own reviver function to `JSON.parse`, for example to handle Date objects the following reviver can be used:
142143

143144
```javascript
144145
import { RedisPubSub } from 'graphql-redis-subscriptions';

0 commit comments

Comments
 (0)