Skip to content

0xor1/Core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Core

A collection of core classes used in other libraries and APIs. See the docs for a full and detailed description of the Core classes.

Building

>npm install
...
>grunt

##Quick Start


##Eventable

var cat = new CORE.Eventable()
	, dog = new CORE.Eventable()
	;

	//cat listens for the dogs 'bark' event
	cat.on(dog, 'bark', cat.runAway);

	//dog fires its 'bark' event
	dog.fire({
		type: 'bark'
	});

	//cat.runAway(event) is called

	//cat stops listening to the dogs 'bark' event
	cat.off(dog, 'bark', cat.runAway);

	//dog fires its 'bark' event
	dog.fire({
		type: 'bark'
	});

	//cat does not respond as it is no longer listening to the dogs bark event.

	//cat listens for the dogs 'bark' event
    cat.on(dog, 'bark', cat.runAway);

    //dispose of the cat
    cat.dispose();

    //dog fires its 'bark' event
    dog.fire({
    	type: 'bark'
    });

    //cat does not respond because there is no cat

##Dom

inherit in the usual way:

	var myDomControl = function(arg){

		CORE.Dom.call(this, someArgs);

		// + Some custom properties for myDomControl

	};

	myDomControl.prototype = Object.create(CORE.Dom.prototype);

	// + some custom methods for myDomControl

About

Core classes used in other libraries and API's.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published