UNPKG

kaaa-class

Version:

A simple js class (Inheritence, Supers, Eventing)

36 lines (35 loc) 1.59 kB
{ "name": "kaaa-class", "version": "0.0.7", "description": "A simple js class (Inheritence, Supers, Eventing)", "author": { "name": "florianBellazouz", "email": "bellazouz.florian@gmail.com" }, "keywords": [ "class", "simple", "inheritence", "Supers", "Eventing" ], "main": "main.js", "dependencies": {}, "devDependencies": {}, "repository": { "type": "git", "url": "git@kaaarot.com:kaaa/class.git" }, "contributors": [ { "name": "Florian BELLAZOUZ", "email": "Bellazouz.florian@gmail.com" } ], "readmeFilename": "readme.md", "readme": "Kaaa Class\n====================\nA easy class systeme.\nInheritence, Supers, Eventing\n\nInstallation\n------------\n- `npm install kaa-class`\n\nExample\n-------\n\n````js\nvar Class = require('./kaaa-class');\n\nvar a = Class.extend({\n init:function(){\n console.log(\"coucou\");\n }\n});\n\nvar c = a.extend({\n word:\"what\",\n init:function () {\n this._super();\n console.log(\"hey\");\n this.on('coucou', this.say.bind(this));\n },\n say:function () {\n console.log(this.word);\n },\n});\n\nvar h = c.extend({\n word:\"ok\",\n init:function () {\n this._super();\n console.log(\"super\");\n }\n});\n\nvar b = new h({word:\"nice\"});\nb.trigger(\"coucou\");\n\n// logs :\n// >> coucou\n// >> hey\n// >> super\n// >> nice\n\n````", "_id": "kaaa-class@0.0.4", "_shasum": "7b86f8315d40c4cbfb524775ae908fd9ecfd6e09", "_from": "kaaa-class@*", "_resolved": "https://registry.npmjs.org/kaaa-class/-/kaaa-class-0.0.4.tgz" }