Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bamjs

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bamjs

Backbone with modifications. Adds heirarchy to Views, turns Views into Finite State Machines, adds a mixin for decorating methods and adds utility functions to Models and Collections.

  • 0.7.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
increased by287.5%
Maintainers
1
Weekly downloads
 
Created
Source

Bam

B.A.M

Introduction

Bam is a library intended to aid in the development of webapps. It uses Backbone as a base for its classes, adding methods and classes for common tasks.

There are two core ideas to Bam; firstly that views for a webapp can be arranged in a tree-like data structure and secondly that views are finite state machines.

API

Each Model, Collection and View inherits everything from Backbone's Model, Collection and View.

Bam.View

A Bam View is a tree and, separately, a finite state machine. The tree helps with the hierarchy of components, and the finite state machine helps with transferring user interactions and data changes into interface actions.

Bam.Model

Models have everything a Backbone Model has, with a couple of utility functions for accessing models before and after them in a collection.

next()

If the model is in a collection, this will return the model at the index directly after the index of this model. I.e., if you are the 2nd model in a collection it will return the third.

If the model is not in a collection it will return null. If the model is the last model in a collection it will also return null.

prev()

prev() works the same as next(). The difference it just moves the reverse direction. If the model is the first in a collection then prev() will return null.

Bam.Collection

Collections have everything a Backbone Collection has, with a couple of utility functions for getting the models before and after other models in the collection.

before(model)

Gets the model before the model model in the collection. Ideally used in a collection with a comparator so there is some kind of sort order.

Returns null if the model doesn't exist in the collection or if the model is the first in the collection.

after(model)

Same as before(model) but looks for the model afterwards.

Returns null if the model doesn't exist in the collection or if the model is the last in the collection.

Usage

Adding to the page
Examples

API

TODO

  • Documentation
  • BAM! logo
  • Change from eventPrefix to namespace

Keywords

FAQs

Package last updated on 20 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc