ironwing
Version:
Ironwing is a lightweight front-end data library for model like data representations
35 lines (27 loc) • 1.24 kB
JavaScript
;
// constructors: IW(type) -> Asks the API for the sepcific ResultSet (it can return an array or a single object) respecting the REST mapping
//
// IW(type,id) -> Asks the API for a specific model with the given ID (returns a single object)
//
// IW(type,id,attr) -> Creates a model-view with the given attributes and ID that matches the back-end database ID
//
// the addapter attribute serves as the comunication link witht he API
//
// each ViewModel comes with implemeted CRUD methods which can accept a callback function for more flexibile use
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _adaptersJson = require('./adapters/json');
var _coreIw = require('./core/iw');
var _coreIw2 = _interopRequireDefault(_coreIw);
/**
* Inject the adapter to IWjs adapters
*/
_coreIw2['default'].adapters = _coreIw2['default'].adapters || {};
_coreIw2['default'].adapters.JSON = (0, _adaptersJson.adapt)();
if (typeof window === 'object') {
window.ironwing = _coreIw2['default'];
}
exports['default'] = _coreIw2['default'];
module.exports = exports['default'];