mixturejs

ES6/ES5 mixins, events, and object manipulation tools

Usage no npm install needed!

<script type="module">
  import mixturejs from 'https://cdn.skypack.dev/mixturejs';
</script>

README

MixtureJS

Mixins is very powerful abstraction addressing cross-cutting concerns, which can dramatically simplify inheritance graph when used wisely.

MixtureJS is the toolkit combining React-style mixins, Backbone-style events, and minimal set of Underscore-style object manipulation functions. Just what you need when you're working in modern ES5/ES6 envorinment, packed in API which you already know.

Written in TypeScript, works with ES5, ES6, and TypeScript.

API docs: here

Events Performance

MixtureJS implements Backbone API for Events, but internally it's entirely different. Here's the results of the typical run of the performance tests enclosed.

performance

Features

  • Mixable, React-style mixins implementation.
    • Fine-grained control over member merge rules.
    • Can mix both classes and plain objects.
    • Works with and without ES6 class decorators.
  • Object.extend to simulate classes in ES5.
    • 100% backward compatible with Backbone .extend().
    • Complete Mixable support.
    • Native properties declatations (properties specification).
  • Messenger, synchronous events.
    • Can be used as mixin and as a base class.
    • 100% backward API compatibility with Backbone Events (passes Backbone 1.2.x unit test)
    • Much faster than Backbone events.
  • tools
    • Object manipulation tools (assign, defaults, mapObject, etc).
    • Simple logging API with variable log-level and overridable functions. Defaults to the console.