progerxp / sqimitive Goto Github PK
View Code? Open in Web Editor NEWLightweight framework for modular, event-based JavaScript programming
Home Page: http://squizzle.me/js/sqimitive/
License: The Unlicense
Lightweight framework for modular, event-based JavaScript programming
Home Page: http://squizzle.me/js/sqimitive/
License: The Unlicense
Sqimitive.js - a JavaScript primitive ===================================== Sqimitive is a lightweight framework of several classes for modular, event-based programming on top of native ES5+ JavaScript, in browser or server environment. * Ubiquitous events - reactive programming and inheritance without "__super__" * Unlimited nesting of objects - powerful collections out of the box * Tight integration with the DOM - working with data objects, not nodes The motto is: do not over-engineer. * No transpilers * No trove of classes * No complicated solutions * Simplicity is key Size: 27K minified, 9K gzipped. Sqimitive is the integral part of HeroWO.js - a JavaScript re-implementation of Heroes of Might and Magic III. * https://github.com/HeroWO-js/Workbench * https://herowo.game Dependencies ============ Mandatory, one of: * NoDash (https://squizzle.me/js/nodash) * underscorejs.org * lodash.com Optional (for Sqimitive.jQuery only), one of: * jquery.com * zeptojs.com Documentation ============= The awfully detailed reference: https://squizzle.me/js/sqimitive An introductory article in Russian: https://habr.com/ru/post/239149/ Ways to install =============== $ npm install sqimitive License ======= Public domain. http://unlicense.org --- Squizzle โฅ it https://squizzle.me
Testling, and then devs will always know in which browsers Sqimitive works, with a bagde in your README like this one (hope it will be more green :)):
if (typeof func == 'string') {
var parts = func.split(/([.-].*)/)
if (parts.length > 1) {
return Core.masker(parts[0], parts[1], obj)
} else {
return function () {
var callCx = obj || this
return callCx[func].apply(callCx, arguments)
}
}
} else {
return obj ? _.bind(func, obj) : func
}
vs
if (typeof func == 'string') {
var parts = func.split(/([.-].*)/)
if (parts.length > 1) {
return Core.masker(parts[0], parts[1], obj)
}
return function () {
var callCx = obj || this
return callCx[func].apply(callCx, arguments)
}
}
return obj ? _.bind(func, obj) : func
if (_.isArguments(value)) {
return Array.prototype.slice.call(value)
} else if (!_.isArray(value)) {
return [value]
} else {
return value
}
vs
if (_.isArguments(value)) {
return Array.prototype.slice.call(value)
}
if (!_.isArray(value)) {
return [value]
}
return value
if (typeof event == 'object') {
for (var name in event) {
var names = name.split(', ')
for (var i = 0, l = names.length; i < l; ++i) {
this.fuse(names[i], event[name], func)
}
}
return this
} else if (arguments.length >= 2) {
return this._regHandler( this.fuse(event, func, cx) )
} else {
throw 'on: Bad arguments'
}
vs
if (typeof event == 'object') {
for (var name in event) {
var names = name.split(', ')
for (var i = 0, l = names.length; i < l; ++i) {
this.fuse(names[i], event[name], func)
}
}
return this
}
if (arguments.length >= 2) {
return this._regHandler( this.fuse(event, func, cx) )
}
throw 'on: Bad arguments'
and so on... I understand that this may be just your preferred codestyle, but I think it's a good pattern to make code more readable at least from visual side.
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions
JSCS:
jscs is a code style checker. You can configure jscs for your project in detail using over 60 validation rules, including presets from popular style guides like jQuery.
I can help you with it, but you should define your codestyle and express it with .eslint
and .jscsrc
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.