Skip to content

Instantly share code, notes, and snippets.

@stlsmiths
Created September 26, 2012 17:55
Show Gist options
  • Save stlsmiths/3789508 to your computer and use it in GitHub Desktop.
Save stlsmiths/3789508 to your computer and use it in GitHub Desktop.
Y.MyAwesomeView = Y.Base.create('myview',Y.View,[],{
// static props and methods
},{
// attrs and stuff
});
// referring to http://yuilibrary.com/yui/docs/api/classes/Base.html#method_create
//
// what is the diff
// Case A - is THIS legal?, or does the 2nd arg have to be a Core component (or Y.Base)
Y.MyOneOffView = Y.Base.create('myview1', Y.MyAwesomeView,[],{
// even more great static stuff here ....
},{
// and more better ATTRS here
});
// and Case B
Y.MyOneOffView = Y.Base.create('myview1', Y.View, [ Y.MyAwesomeView ], {
// even more great static stuff here ....
},{
// and more better ATTRS here
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment