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
- Rails template rendering is very powerful
- Paired with Turbolinks it is a very snappy experience
- Sometimes vanilla jQuery isn't enough, but Backbone/React/Angular/Ember is overkill
- 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
>...
@register : superel @datauser # user data as json # bind to updating user.first_name @databind 'user.first_name' # do something with updated value @dataset'user.first_name''Gabe' @emit'someEventToAllOtherComponents'42 @on 'someEventFromAnotherComponent' # do something with something @children # all components which are lower in hierarchy # returns an array of all child BrewhouseComponent @childrenwhereBrewhouseComponent # returns an array of all child components where data-cool-dude is 'Chuck' @childrenwherecoolDude: 'Chuck' # returns the first found child component where data-can-code is 'Chan' # and then bind to changes in puns @childrenfindcanCode: 'Chan'databind 'puns' # do something with pun