Package Exports
- extendable-record
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (extendable-record) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Dependencies
Getting Started
npm install extendable-record --save
Usage
import { ExtendableRecord } from 'extendable-record';
export class BaseModel extends ExtendableRecord {}
BaseModel.defaultProperties = {
isRequired: false,
name: '',
id: null
};
export class PrimitiveModel extends BaseModel {
getValue() {
return this.value;
}
setVaule(newValue) {
return this.set('value', newValue);
}
}
PrimitiveModel.defaultProperties = {
value: null
};
var myModel = PrimitiveModel({value: 2, id: 'myModelId'});
var myNewModel = myModel.setValue(4)
Credits
- ImmutableJS for underlying data structures
- Hexbridge for sponsoring my open-source work.
- npm-starter
- Airbnb for the work they've put into the javascript style guide and into the ESlint package.
License
MIT @ Joe Delgado