Skeletor is a modernization of Backbone's Models and Collections.
It provides you with a more modern Backbone-like way to manage state.
npm install @converse/skeletor
We've made big, backwards incompatible changes in version 2:
- Removed the old
View - Removed the old
Eventsconstructor function and instead added theEventsEmittermixin class. - Removed the
RouterandHistoryclasses. - All other types (
Model,Collection) are now ES6 classes.
- Added TypeScript type declarations (generated from typed JSDoc comments)
- Removes the dependency on jQuery
- Replaces underscore with lodash
- Imports lodash methods individually to allow for tree-shaking
- Uses the native browser API instead of lodash whereever possible
- Drops support for older browsers (including IE) and uses ES6+ language features
- Splits models and collections into separate modules
- Adds the possibility to returns promises for asynchronous operations
- Collection.prototype.forEach no longer returns the items being iterated over.
If you need that, use
mapinstead. - The
chain,cloneandescapemethods on Models have been removed. - The
clonemethod has also been removed from Collections - The
inject,foldlandfoldrmethods on Collections has been removed. You can usereduceinstead. - Removed the
sample,take,tailandinitialmethod on Collections. - Removed the
without,rejectandselectmethods on Collections, usefilter. - Removed the
.extend()method onModelandCollection. - Models and Collections should be defined via
class .. extendssyntax.
- Use
dropinstead ofrest. indexByis calledkeyBy- Use
invokeMapfor collections instead ofinvoke. - Use
includesinstead ofcontains - The
partitionandinvokeMapmethods have been removed.
