Skip to content

Instantly share code, notes, and snippets.

View sly7-7's full-sized avatar

Sylvain Mina sly7-7

  • ERDIL
  • Besançon, France
  • X @sly7_7
View GitHub Profile
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
data = [
{
firstName: 'Tony',
lastName: 'Stark',
points: 99
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { later } from '@ember/runloop';
export default Controller.extend({
appName: 'Ember Twiddle',
bar: null,
foo: computed('bar', async function() {
@sly7-7
sly7-7 / adapters.author.js
Created May 21, 2021 10:00 — forked from Herriau/adapters.author.js
EmberData: Unnecessary inverse relationship requests
import JSONAPIAdapter from 'ember-data/adapters/json-api';
export default class AuthorAdapter extends JSONAPIAdapter {
async findRecord(store, type, id) {
console.log(`Requesting http://localhost:3000/authors/${id}`);
return {
"data": {
"id": "1",
"type": "authors",
"links": {
"self": "http:\/\/localhost:3000\/authors\/1"