I am trying to use the API in this page.
The definition is like this below:
vline.Promise.<vline.Collection> getMessages([Number opt_limit])
I want to use the return value of this API, however I don't understand what the <>
means. I have researched about the JavaScript language but I couldn't find any clues.
My script is:
vlinesession.getPerson(userId).done(function(person) {
person.postMessage(msg); //it works.
var log = person.getMessages(20); //how can I parse 'log'?
}
Can anyone give me a hint or some samples on how to use this API?
@cbuckley is correct in his description, but I want to expand on it and give an example.
This indicates that it is returning a
vline.Promise
with the result to the success callback being of typevline.Collection
.Here's an example:
Note that I left out the
fail
handlers for brevity, but you should include those as well to make your code robust.