We strive to make the Prime.js API as consistent as possible. Our functions only ever have one return type and one set of parameters. We don’t use the same function to get and set variables. Instead, we use explicit functions for each. We use consistent naming rules for functions whenever possible and try to make function parameters and return types as consistent as possible.
new Prime.Ajax.Request(‘/foo.js’). withSuccessHandler(this.successHandler). withErrorHandler(this.errorHandler). withContext(this). go();
Prime.js allows you to control the this variable whenever possible. This means you can use your own objects as event listeners or callbacks and the this variable will be set to your object.
Under the hood, Prime.js uses the excellent Sizzle (http://sizzlejs.com) selector engine. This is same engine used by jQuery, which means that developers familiar with the jQuery style of selecting will be able to jump right into using Prime.js.
Prime.js is also fully documented using JSDoc. Many IDEs can use JSDoc to provide good intelli-sense as well as pop-up documentation. It also allows us to generate the documentation on the Prime.js website.
Finally, we wanted Prime.js to be easily debuggable in the browser. Therefore, every function, namespace and object in Prime.js is explicit. We don’t generate code or eval anything. If you run against the original source code for Prime.js, you’ll be able to step into any of our objects and functions.
We encourage you to check out Prime.js and give us your thoughts and feedback.