Sometimes you'll have objects that manage state along with event handling. This happens frequently in MVC apps. Let's start with a messy example:
var Launcher = function(rocket) {
this.rocket = rocket
}
Launcher.prototype.isReady = function() {
| sudo -i | |
| cd | |
| apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y | |
| wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz | |
| tar xzvf ImageMagick-6.8.9-1.tar.gz | |
| cd ImageMagick-6.8.9-1/ | |
| ./configure --prefix=/opt/imagemagick-6.8 && make | |
| checkinstall |
| // The API accepts the page parameter and returns the pagination info in meta | |
| { | |
| "messages": [ ... ], | |
| "meta": { | |
| "pagination": { | |
| "total_pages": 3, | |
| "current_page": 1, | |
| "total_count": 55 | |
| } |