Skip to content

Instantly share code, notes, and snippets.

View rtablada's full-sized avatar

Ryan Tablada rtablada

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super(...arguments);
// To simulate async data loading
window.setTimeout(() => {
this.set('becomeAMemberLink', 'http://google.com');
}, 500);

The jsonapi.org serializers in JS right now are not great.

They don't account well for includes, fields, attribute definitions, relations definitions. Denali does handle jsonapi.org well but the serialization is coupled to rest of the framework. json-api-serializer has type registrations but does not handle request options like sparsefieldsets or includes.

I think the API provided for json-api-serializer is close but to add support for the missing options I think a new API should be changed a bit.

The serialize API

@rtablada
rtablada / 00-motivation.md
Last active March 28, 2018 18:45
Ember Contact Manager

Motivation

The motivation behind the contact book is that it aims to have a universally understandable domain that is pretty complex in where it can be expanded. The idea is that this is a launching off point for further tutorials and even guides for addons.

While for the initial tutorial the problem set is simple CRUD for plain fields, a contact book can expand to a much more complex problem and can include:

  • Nested Arrays of Data `phoneNumbers: [{countryCode: '1', areaCode: '555', phone: '5555555'}]
  • HasOne/HasMany Relations: messages
  • Many to many relationships: addresses
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@rtablada
rtablada / memory.md
Last active November 28, 2023 19:21
var x = 5;
const name = 'Homer';

let homer = {
  first: name,
  last: 'Simpson'
};
import Ember from 'ember';
export default Ember.Component.extend({
didReceiveAttrs() {
this._super(...arguments);
const filterBy = this.get('filter');
if (filterBy !== null) {
this.set('items', this.filterItems(filterBy));
} else {
console.log('no filter');
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
  1. User can login with Twitter
{
  resolutions: [
    // Period Object
    {
      userId: GUID,
      name: String,
 start: Date,
@rtablada
rtablada / bus
Last active December 30, 2018 17:55
Rail
Rail
---
---
Power
Power
---
---