npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

backbone.ribs

v0.5.13

Published

Deep get/set, bindings and computed model attributes for Backbone.

Downloads

20

Readme

Backbone.ribs - Wiki

Backbone.ribs expands capabilities of Backbone.

Deep Get & Set

Ribs allow to get and set model attributes on any depth.

var model = new Backbone.Ribs.Model({
    foo: {
        bar: 'test'
    }
});

model.get('foo.bar'); //"test"
model.set('foo.bar', 'newValue');

Computed attributes

With Ribs you can add computed model attributes.

var CompModel = Backbone.Ribs.Model.extend({
    defaults: {
        bar: 10,
        foo: 20
    },

    computeds: {
        fooBarComp: {
            deps: ['bar', 'foo'],
            get: function (bar, foo) {
                return bar + '-' + foo;
            }
        }
    }
});

var compModel = new CompModel();

compModel.set('bar', 30);
compModel.get('fooBarComp'); //30-20

Bindings

Bindings allow you to set a one-way or two-way binging between the models and the DOM elements.

Binding Collection

Binding collection is useful in cases when you need to create a view for a collection - tables, lists and other structures with multiple similar items.

During applying binding, for each model in the collection will be created its own instance of ItemView. The root element of the newly created view will be added inside the element, which selector was described in binding.

Change Log

v0.5.11 - 25.01.2016

  • Bindings: bug fixes

v0.5.10 - 27.12.2015

  • Computeds: bug fixes

v0.5.9 - 25.12.2015

  • Bindings: some optimizations
  • Computeds: bug fixes

v0.5.8 - 12.12.2015

  • Bindings: bug fixes
  • Bindings: using Backbone.Model for bindings is deprecated (will be deleted in v1.0.0)

v0.5.7 - 11.12.2015

  • Bindings: binding toggleByClass - added !important declarations
  • Bindings: inDOM binding bug fixes (will be deleted in v1.0.0)

v0.5.6 - 05.12.2015

  • Bindings: new binding type - toggleByClass
  • Bindings: inDOM binding bug fixes

v0.5.5 - 02.12.2015

  • Computed attributes: fixed model.clone() bug

v0.5.4 - 29.11.2015

  • Computed attributes: returned computed attribute without deps for backward compatibility (will be deleted in v1.0.0)
  • Computed attributes: returned update computed attributes by triggering 'change' event

v0.5.3 - 04.11.2015

  • Model: pass changed attribute's name into event's callback

v0.5.2 - 31.10.2015

  • Computeds: toJSON flag in declaration
  • Bindings: some optimizations
  • Deep get/set: bug fix

v0.5.1 - 29.10.2015

  • Bindings: bindings, handlers and filters can be a function
  • Bindings: custom events in custom handlers

v0.5.0 - 25.10.2015

  • Compatibility with Backbone 1.2.3
  • Computed attributes: computed attributes in model.attributes hash (significant change)
  • Computed attributes: deprecate computed attribute without deps (significant change)
  • Computed attributes: fixed problem with triggering excess change events
  • Computed attributes: new method isComputed
  • Bindings: binding callback
  • Bindings: updated bindings earlier than other handlers
  • Bindings: inDOM - fixed many problems. And now you can use it ;)
  • Binding Collection: allow waterfall adding views to DOM
  • Allow to get previous model's attributes on any depth by deepPrevious flag (this slows down the model.set, be careful)

v0.4.6 - 25.03.2015

  • forwarding event object into get binding handler

v0.4.5 - 16.03.2015

  • inDOM binding bug fixes

v0.4.4 - 11.03.2015

  • passing options to set binding handler

v0.4.3 - 04.03.2015

  • set and get in not filter

v0.4.2 - 03.12.2014

  • bug fixes

v0.4.1 - 16.11.2014

  • no more sorting collection in applying binding collection
  • optimize rendering binding collection when adding new models to the collection
  • new view method signature of renderCollection

v0.4.0 - 14.11.2014

  • new model method addComputeds
  • new model method signature of removeComputeds
  • model method addComputed is redundant, use addComputeds (will be deleted in v1.0.0)
  • bug fixes

v0.3.1 - 11.11.2014

  • new binding type inDOM
  • new view method getEl
  • new view method appendTo
  • new view method addBindings
  • new view method signature of updateBindings
  • new view method signature of renderCollection (incompatible with v0.2.10)
  • new view method getCollectionViews
  • view method addBinding is redundant, use addBindings (will be deleted in v1.0.0)
  • view method applyCollection is redundant, use addBindings (will be deleted in v1.0.0)
  • bug fixes and optimisation