Skip to content

Commit

Permalink
Updated dummy app; added ember fetch; updated readme; removed unused …
Browse files Browse the repository at this point in the history
…addons
  • Loading branch information
gspain committed Feb 19, 2020
1 parent 75b7cb2 commit e1cd70d
Show file tree
Hide file tree
Showing 15 changed files with 397 additions and 22,138 deletions.
33 changes: 1 addition & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,11 @@ ember install @gavant/ember-pagination
Usage
------------------------------------------------------------------------------

There are two ways to use this addon.

For classic classes, you use the mixin.

For Native classes, you use the "mixin".
```
import Route from '@ember/routing/route';
import RoutePagination from '@gavant/ember-pagination/mixins/route-pagination';
export default Route.extend(RoutePagination, {
model() {
const params = this.getControllerParams();
return get(this, 'store').query('account', params);
}
});
```

For Native classes, you use the "decorator".
```
import Route from '@ember/routing/route';
import RoutePagination from '@gavant/ember-pagination/decorators/route-pagination';
export default class Accounts extends RoutePagination(Route) {
model() {
const params = this.getControllerParams();
Expand All @@ -51,21 +35,6 @@ export default class Accounts extends RoutePagination(Route) {
}
```

Technically speaking you can actually use the route-pagination as a decorator..
```
import Route from '@ember/routing/route';
import RoutePagination from '@gavant/ember-pagination/decorators/route-pagination';
@RoutePagination
export default class Accounts extends Route {
model() {
const params = this.getControllerParams();
return this.store.query('account', params);
}
}
```
but the main issue with that is RoutePagination will be the extend the `Accounts` Route, and generally you want the order of that to be reversed.

Contributing
------------------------------------------------------------------------------

Expand Down
146 changes: 0 additions & 146 deletions addon/decorators/controller-pagination.ts

This file was deleted.

54 changes: 0 additions & 54 deletions addon/decorators/route-pagination.ts

This file was deleted.

Loading

0 comments on commit e1cd70d

Please sign in to comment.