Skip to content

Instantly share code, notes, and snippets.

@LNA
Last active March 30, 2016 18:58
Show Gist options
  • Save LNA/dd9bba3e093e4f73d82a00585637a4ab to your computer and use it in GitHub Desktop.
Save LNA/dd9bba3e093e4f73d82a00585637a4ab to your computer and use it in GitHub Desktop.
Things I should know more about: EmberConf 2016

#Methods Use the {{GET}} helper http://emberjs.com/api/classes/Ember.Templates.helpers.html#

loc http://emberjs.com/api/classes/Ember.Templates.helpers.html#method_loc

mut http://emberjs.com/api/classes/Ember.Templates.helpers.html#method_mut

contextual components http://emberjs.com/blog/2015/11/16/ember-2-2-released.html#toc_contextual-components

#Concepts ##Data Down, Actions Up: Describes the flow of data through the app

Only the owner of the data should be able to modify it

Actions are here to make Ember more functional

##Controllers Are Dead: The implementation is changing

Routable component instead. It decorates the model. It's the unification of a controller and a view.

Top level component separates concerns

##Actions

Use closure actions not class or string actions

Don't use sendAction

Closure actions are really just javascript functions

ember-route-action-helper

##Services

(Look into this)

Don't abuse them

##Helpers

Simple to debug

Use helpers for generic utility functions/UI logic. DRY up code/templates.

Can be used as action

Use to pass down data

ember-composable-helpers

Don't nest helpers. Better to use a computed property

Use for UI and presentational logic instead of computed properties, which are coupled with data.

##Computed Properties

Don't overuse! (I'm probably doing this)

Use for expressing business logic

Can use to create custom macros (no thank you)

The are cached. Expensive work is only done when it needs to be done.

##Component Hooks

Prefer to use a computed property

Best to use when you need a side effect

Prefer over observer

##Observers

Don't use them

Low level primitives used by Ember so we don't have to

Someone dies inside when you use them, so don't do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment