Simplify with getLastMessage()

This commit is contained in:
Ian Gulliver
2014-05-26 10:03:27 -07:00
parent 34744c2a36
commit f1a670749d

View File

@@ -116,8 +116,8 @@ cosmo.subscribe('testsubject');</pre></li>
<li>Change your test script:
<pre>var cosmo = new Cosmopolite();
cosmo.subscribe('testsubject', 1).then(function() {
var msgs = cosmo.getMessages('testsubject');
alert(msgs[msgs.length - 1]['message']);
var msg = cosmo.getLastMessage('testsubject');
alert(msg['message']);
});</pre></li>
<li>Your test page should generate an alert popup showing the last message sent</li>
</ol>