Skip to content

Instantly share code, notes, and snippets.

@barneycarroll
Created February 1, 2016 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barneycarroll/756c3626d7009531b3ad to your computer and use it in GitHub Desktop.
Save barneycarroll/756c3626d7009531b3ad to your computer and use it in GitHub Desktop.
Ember plugin: Extensible className additions http://discuss.emberjs.com/t/extensible-classname-additions/9601
import Ember from 'ember'
const pushTo = key => ( ...items ) =>
Ember.Mixin.create( {
init(){
this._super( ...arguments )
this[ key ].push( ...items )
}
} )
const names = pushTo( 'classNames' )
const bindings = pushTo( 'classNameBindings' )
export default Object.assign( names, { names, bindings } )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment