Skip to content

Instantly share code, notes, and snippets.

@mriska
Last active June 23, 2016 11:23
Show Gist options
  • Select an option

  • Save mriska/4b2bf356d013c3116cbb to your computer and use it in GitHub Desktop.

Select an option

Save mriska/4b2bf356d013c3116cbb to your computer and use it in GitHub Desktop.
Ember best practices

Ember best practices

DDAU (Data Down, Actions Up)


  • Should we allow data fetching in our components?
  • Are simple input-fields allowed to use two-way binding?

Observers/Computeds

didReceiveAttrs

Closure actions

Functions instead of strings

Return values (no more returning false to stop bubbling)

Multiple sources in route model

  • Now we usually load the main data in model hook, and the rest in setupController
  • -> leads to weird states, and application not be fully usable before all promises have resolved

Ember.RSVP.hash to the rescue

Loading/Error substate

Ember.Data

Define type of DS.attr

  • Problem in Altus offline -> non-evident datatype because of storage
  • Serves as documentation

Define inverse relationship on models

  • Problem in Altus offline/IL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment