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

Update doc examples with ES6 Classes #447

Closed
Gorzas opened this issue May 6, 2021 · 0 comments
Closed

Update doc examples with ES6 Classes #447

Gorzas opened this issue May 6, 2021 · 0 comments

Comments

@Gorzas
Copy link
Contributor

Gorzas commented May 6, 2021

Today I was using ember-infinity and I needed to replicate the example where there's no total_pages and count in the backend's response. The example didn't work because InfinityModel is now an ES6 class but the example is using the EmberObject.extend approach.

As native classes are supported from Ember > 3.4, then there's no problem to change the example with the following code:

import InfinityModel from 'ember-infinity/lib/infinity-model';

class ExtendedInfinityModel extends InfinityModel {
  canLoadMore = true;
}

Sending PR with more clarification. Could somebody confirm this can be done in the rest of examples?

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