Created
February 1, 2016 10:58
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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