Simplify with getLastMessage()
This commit is contained in:
@@ -116,8 +116,8 @@ cosmo.subscribe('testsubject');</pre></li>
|
|||||||
<li>Change your test script:
|
<li>Change your test script:
|
||||||
<pre>var cosmo = new Cosmopolite();
|
<pre>var cosmo = new Cosmopolite();
|
||||||
cosmo.subscribe('testsubject', 1).then(function() {
|
cosmo.subscribe('testsubject', 1).then(function() {
|
||||||
var msgs = cosmo.getMessages('testsubject');
|
var msg = cosmo.getLastMessage('testsubject');
|
||||||
alert(msgs[msgs.length - 1]['message']);
|
alert(msg['message']);
|
||||||
});</pre></li>
|
});</pre></li>
|
||||||
<li>Your test page should generate an alert popup showing the last message sent</li>
|
<li>Your test page should generate an alert popup showing the last message sent</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|||||||
Reference in New Issue
Block a user