Skip to content

Commit ed04504

Browse files
committed
update README
1 parent 6d81926 commit ed04504

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<img src="https://github.com/jcubic/sysend.js/blob/master/assets/logo.svg?raw=true" alt="Sysend.js logo"/>
33
</p>
44

5-
[![npm](https://img.shields.io/badge/npm-1.14.2-blue.svg)](https://www.npmjs.com/package/sysend)
6-
![bower](https://img.shields.io/badge/bower-1.14.2-yellow.svg)
5+
[![npm](https://img.shields.io/badge/npm-1.14.3-blue.svg)](https://www.npmjs.com/package/sysend)
6+
![bower](https://img.shields.io/badge/bower-1.14.3-yellow.svg)
77
![downloads](https://img.shields.io/npm/dt/sysend.svg)
88
[![jsdelivr](https://img.shields.io/jsdelivr/npm/hm/sysend)](https://www.jsdelivr.com/package/npm/sysend)
99

@@ -94,8 +94,10 @@ To allow domain to listen to sysend communication you need to specify channel in
9494

9595
### Serialization
9696

97-
if you want to send custom data you can use serializer (new in 1.4.0).
98-
Example serializer can be [json-dry](https://github.com/11ways/json-dry).
97+
if you want to send custom data you can use serializer (new in 1.4.0) this API
98+
was created for localStorage that needs serialization.
99+
100+
Example serializer can be [json-dry](https://github.com/11ways/json-dry):
99101

100102
```javascript
101103
sysend.serializer(function(data) {
@@ -105,6 +107,16 @@ sysend.serializer(function(data) {
105107
});
106108
````
107109

110+
or [JSON5](https://json5.org/):
111+
112+
```javascript
113+
sysend.serializer(function(data) {
114+
return JSON5.stringify(string);
115+
}, function(string) {
116+
return JSON5.parse(string);
117+
});
118+
````
119+
108120
## Demos
109121
110122
* [Simple demo using iframes](https://jcubic.pl/sysend-demo/).
@@ -143,7 +155,7 @@ To see details of using the API, see [demo.html source code](https://github.com/
143155
144156
## Story
145157
146-
The story of this library came from my question on StackOverflow in 2014: [Sending notifications between instances of the page in the same browser](https://stackoverflow.com/q/24182409/387194), with hint from user called **Niet the Dark Absol**, I was able to create a PoC of the solution using localStorage. I quickly created a library from my solution. I've also explained how to have [Cross-Domain LocalStorage](https://jcubic.wordpress.com/2014/06/20/cross-domain-localstorage/). The blog post have steady number of visitors (actually it's most viewed post on that blog).
158+
The story of this library came from my question on StackOverflow from 2014: [Sending notifications between instances of the page in the same browser](https://stackoverflow.com/q/24182409/387194), with hint from user called **Niet the Dark Absol**, I was able to create a PoC of the solution using localStorage. I quickly created a library from my solution. I've also explained how to have [Cross-Domain LocalStorage](https://jcubic.wordpress.com/2014/06/20/cross-domain-localstorage/). The blog post have steady number of visitors (actually it's most viewed post on that blog).
147159
148160
And the name of the library is just random word "sy" and "send" suffix. But it can be an backronym for **Synchronizing Send** as in sychronizing application between browser tabs.
149161

0 commit comments

Comments
 (0)