Giter Club home page Giter Club logo

prime's Introduction

prime

Package Info NPM Version Coverage Status Build Status Dependencies Status DevDependencies Status

  1. fundamental, basic, essential.
  2. make (something) ready for use or action.
  3. 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.

prime's People

Contributors

kamicane avatar arian avatar ibolmo avatar gcheung55 avatar subtlegradient avatar cpojer avatar kentaromiura avatar danfooo-sp avatar sergiocrisostomo avatar devmanny avatar timwienk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.