Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding computed properties is deprecated #17

Open
courthead opened this issue Sep 6, 2019 · 1 comment
Open

Overriding computed properties is deprecated #17

courthead opened this issue Sep 6, 2019 · 1 comment

Comments

@courthead
Copy link

courthead commented Sep 6, 2019

The img-lazy component has three properties (_loaded, _loading, and _src) that are set to computed properties…

_loaded: not('observer.hasIntersectionObserver'),
_loading: oneWay('observer.hasIntersectionObserver'),
_src: computed('width', 'height', 'src', function() {
  if ((isFastBoot && !get(this, 'lazyFastBoot')) ||
    (!isFastBoot && !get(this, 'observer.hasIntersectionObserver'))) {
    return get(this, 'src')
  }

  return placeholder(get(this, 'width'), get(this, 'height'))
}),

…but are later overridden…

set(this, '_loaded', true)
set(this, '_loading', false)
set(this, '_src', src)

Overriding computed properties is now deprecated in the latest version of Ember and results in tons of warnings in the console. There are some instructions on fixing it here: https://deprecations.emberjs.com/v3.x/#toc_computed-property-override

@topaxi
Copy link
Owner

topaxi commented Sep 9, 2019

Hi, I'm not actively maintaining this addon as I'm not using it in any projects at the moment. I'd be happy to accept a PR though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants