Skip to content

Commit bbe8d95

Browse files
committed
serializer explaination
1 parent 8eb3826 commit bbe8d95

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,12 @@ stringify({
280280

281281
## Serializers
282282

283-
The `attr` helper accepts a serializer function.
283+
The `attr` helper accepts a serializer function. The serializer function gets invoked with the real value that should be stringified.
284+
285+
```bash
286+
serializer(rawValue)
287+
```
288+
284289
Property serializers are useful to perform custom serialization on any provide type not natively supported even by `JSON.stringify` (Dates, regular expressions).
285290
They can be used also to skip property serializarion when returning `undefined`.
286291

0 commit comments

Comments
 (0)