ribcage-gen
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -0,5 +1,13 @@ | ||
'use strict'; | ||
var Base = require('ribcage-view') | ||
, _ = require('lodash') | ||
, State = require('ampersand-state').extend({ | ||
// forces you define all properties on the state model | ||
// this helps catch bugs and makes code more readable | ||
extraProperties: 'reject' | ||
// output the derived properties and the props in toJSON | ||
, toJSON: function toJSON(){ | ||
return _.extend(this.serialize(), this.getAttributes({derived: true})) | ||
} | ||
}) | ||
@@ -42,2 +50,18 @@ | ||
// helper methods | ||
// e.g. | ||
// , findModelIndex: function findModelIndex(model){ | ||
// this.collection.findIndex(model) | ||
// } | ||
// public methods | ||
// e.g. | ||
// , getLabel: function getLabel(){ | ||
// return this.state.label | ||
// } | ||
// | ||
// , setLabel: function setLabel(label){ | ||
// this.state.label = label | ||
// } | ||
// Create Subviews | ||
@@ -54,3 +78,3 @@ // , createSubviewX: function createSubviewX(){ | ||
// instantiate subviews | ||
, afterInit: function afterInit() { | ||
, afterInit: function afterInit(){ | ||
// e.g. | ||
@@ -60,3 +84,3 @@ // this.subviewX = this.createSubviewX() | ||
, afterRender: function afterRender() { | ||
, afterRender: function afterRender(){ | ||
// e.g. | ||
@@ -66,3 +90,3 @@ // this.appendSubview(this.subviewX) | ||
, context: function context() { | ||
, context: function context(){ | ||
return this.state.toJSON() | ||
@@ -69,0 +93,0 @@ } |
{ | ||
"name": "ribcage-gen", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "A generator script for ribcage components", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
11819
288