+4
-4
| { | ||
| "name": "crosser", | ||
| "version": "0.1.1", | ||
| "version": "0.1.2", | ||
| "description": "Cross-frame sessions service", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
| "type": "git", | ||
| "url": "https://github.com/ramybenaroya/crosser.git" | ||
| "url": "https://github.com/DudaDev/crosser.git" | ||
| }, | ||
@@ -17,5 +17,5 @@ "author": "Ramy Ben Aroya", | ||
| "bugs": { | ||
| "url": "https://github.com/ramybenaroya/crosser/issues" | ||
| "url": "https://github.com/DudaDev/crosser/issues" | ||
| }, | ||
| "homepage": "https://github.com/ramybenaroya/crosser", | ||
| "homepage": "https://github.com/DudaDev/crosser", | ||
| "dependencies": { | ||
@@ -22,0 +22,0 @@ "rsvp": "^3.0.17" |
+10
-11
@@ -6,6 +6,12 @@ # Crosser | ||
| ## Life Cycle | ||
| - One of the frames starts a session which the other frame can subscribe to by name via a callback. | ||
| - One of the frames triggers a session which the other frame can subscribe to by name via a callback. | ||
| - Once the subscriber's callback is called, its return value will be resolved within the initiator frame and the session will end. | ||
| Although the session has ended, the subscriber will start next time when a new session with the same name will be initialized. | ||
| Although the session has ended, the subscriber will be called next time when a new session with the same name will be initialized. | ||
| ## Installation | ||
| ``` | ||
| npm install crosser --save | ||
| ``` | ||
| ## Code Example | ||
@@ -21,3 +27,3 @@ | ||
| // Start a session | ||
| crosser.start('session-name', {message: 'message from frame1'}) | ||
| crosser.trigger('session-name', {message: 'message from frame1'}) | ||
| .then(function(payloadFromFrame2){ | ||
@@ -43,9 +49,2 @@ alert(payloadFromFrame2.message) // 'message from frame2' | ||
| ## Installation | ||
| ``` | ||
| npm install crosser --save | ||
| ``` | ||
| ## API Reference | ||
@@ -60,3 +59,3 @@ | ||
| ####`start (sessionName, payload)` | ||
| ####`trigger (sessionName, payload)` | ||
| - arguments: | ||
@@ -63,0 +62,0 @@ - sessionName [`String`] |
7662
-0.08%98
-1.01%