question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Computed property macros

See original GitHub issue

ember-i18n has a translationMacro, which essentially generates a computed property listening to i18n.locale (see https://github.com/jamesarosen/ember-i18n/blob/master/addon/utils/macro.js). Would something like that be desirable in ember-intl too?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:34 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
kellyseldencommented, Oct 28, 2016

Oh boy, it may overkill to addonify raw. It is so tiny: https://github.com/kellyselden/ember-awesome-macros/blob/master/addon/raw.js

export default function(key) {
  return computed(() => key);
}
1reaction
jasonmitcommented, Oct 28, 2016

@marcoow that can conflict, so I’d prefer either a wrapper to signify literal v. path or my original syntax.

https://github.com/emberjs/ember.js/pull/4185 I wish this had landed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Computed Properties - The Object Model - Ember Guides
Some types of computed properties are very common. Ember provides a number of computed property macros, which are shorter ways of expressing certain...
Read more >
Refactoring with computed property macros - EmberMap
Now, computed property macros are really just computed properties that do something that's very common, like calculating a sum, or mapping from an...
Read more >
eslint-plugin-ember/require-computed-macros.md at master
An ESLint plugin that provides set of rules for Ember applications based on commonly known good practices. - eslint-plugin-ember/require-computed-macros.md ...
Read more >
Computed Property Macros - Ember Observer
ember-group-by - An Ember.js computed property macro for grouping objects by a given property. Computed Property Macros Last updated 4 years ago.
Read more >
9 (revised) - Computed Property Macros - Ember Screencasts
Break up giant functions and make your logic beautiful using Ember.computed macros. In this episode, we learn the basics, then refactor a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found