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

burger

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

burger

A lightweight turbolinks friendly JavaScript library

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Burger.js

Work in progress...

A light-weight JavaScript component library meant to be awesome with Turbolinks.

Has hard dependencies on both jQuery and lodash.

npm install burger

gem install burger

What I'm going on about, friend

  1. Rails template rendering is very powerful
  2. Paired with Turbolinks it is a very snappy experience
  3. Sometimes vanilla jQuery isn't enough, but Backbone/React/Angular/Ember is overkill
  4. Not intended to be a full framework, just a library for small pieces of JavaScript behaviour

Looking for features, guy?

  • ES6/Coffeescript class based component declaration
  • Data syncing with data-tags
  • Simple two-way binding
  • Some other crap

Some things to get working

  • Light template binding
  • more operations for dealing with children
  • Some other crap

Example

<div data-burger="MyComponent" data-user=<%= current_user.to_json %>>...</div>
class MyComponent extends Burger.Component
  @register()

  constructor: (el) ->
    super(el)

    @data.user # user data as json

    # bind to updating user.first_name
    @data.bind 'user.first_name', (value) ->
      # do something with updated value

    @data.set('user.first_name', 'Gabe')

    @emit('someEventToAllOtherComponents', 42)

    @on 'someEventFromAnotherComponent', (event, something) ->
      # do something with something

    @children # all components which are lower in hierarchy

    # returns an array of all child BrewhouseComponent
    @children.where(BrewhouseComponent)

    # returns an array of all child components where data-cool-dude is 'Chuck'
    @children.where(coolDude: 'Chuck')

    # returns the first found child component where data-can-code is 'Chan'
    # and then bind to changes in puns
    @children.find(canCode: 'Chan').data.bind 'puns', (pun) ->
      # do something with pun

Keywords

FAQs

Package last updated on 10 Mar 2015

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