0.5.0 • Published 9 years ago
prime v0.5.0
- fundamental, basic, essential.
- make (something) ready for use or action.
- archetypal, prototypical, typical, classic.
Description
prime is an Object Oriented JavaScript library. It helps you with prototypal inheritance and contains generic utilities for every-day JavaScripting.
No Native JavaScript Objects were harmed in the making of this library.
Modules Overview
A short overview of the available modules. For more information, refer to the documentation.
prime
The function to create new primes.
var prime = require("prime")
var Animal = prime({
say: function(){
return "!!"
}
})
var Emitter = require("prime/emitter")
var Cat = prime({
inherits: Animal,
mixin: Emitter,
say: function(){
return "meaow" + Cat.parent.say.call(this)
}
})
prime/emitter
The event emitter.
var Emitter = require("prime/emitter")
var Dog = prime({
inherits: Animal,
mixin: Emitter,
say: function(){
var word = "wuff" + Dog.parent.say.call(this)
this.emit("say", word)
return word
}
})
var barkley = new Dog
barkley.on("say", function(word){
console.log("barkley barked", word)
})
prime/map
Map-like implementation.
var Map = require("prime/map")
var map = new Map()
map.set(domElement, "header")
map.set(domElement2, "footer")
map.get(domElement) // "header"
map.get(domElement2) // "footer"
prime/defer
Optimized timeouts / immediates / animationFrames.
var defer = require("prime/defer")
defer.frame(function() {
console.log('on next animation frame');
});
defer.immediate(function() {
console.log('on platform next tick.');
});
defer.timeout(function() {
console.log('late');
}, 500);
When all else fails, read the full documentation.
0.5.0
9 years ago
0.4.2
10 years ago
0.4.1
10 years ago
0.4.0
10 years ago
0.3.2
10 years ago
0.3.1
11 years ago
0.3.0
11 years ago
0.2.1
11 years ago
0.2.0
11 years ago
0.1.0
11 years ago
0.0.6
11 years ago
0.0.5-alpha
12 years ago
0.0.4-alpha
12 years ago
0.0.3-alpha
12 years ago
0.0.2-alpha
12 years ago
0.0.1-alpha
12 years ago