/**
* all API calls will being with /api
*/
ironwing.useAdapter('JSON', ['api']);
/**
* GET Users collection
* GET -> /api/users
*/
ironwing('users').then((users) => {
console.log(users.length);
});
extensible
abstract layer over transport
Proxy objects
ironwing('users', 1).then((user) => {
console.log('My name is ', user.attr.firstName);
});
// My name is John
let user = ironwing.storage.find('users', 1);
export default function render() {
document
.getElementById('user-firstname')
.text(user.attr.firstName);
}
user-firstname-component.js
stores all models
everything done on the model is mirrored on the storage