{"id":16365815,"url":"https://github.com/charlesfries/ember-cloud-firestore-adapter-pagination","last_synced_at":"2026-05-08T17:36:04.226Z","repository":{"id":93529647,"uuid":"396998159","full_name":"charlesfries/ember-cloud-firestore-adapter-pagination","owner":"charlesfries","description":"Get Cloud Firestore pagination data automatically via the DS.PromiseArray#meta object returned by store.query()","archived":false,"fork":false,"pushed_at":"2021-12-08T18:18:48.000Z","size":550,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-30T22:00:17.523Z","etag":null,"topics":["cloud-firestore","ember","ember-addon","ember-data","firebase","pagination"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charlesfries.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-16T22:36:29.000Z","updated_at":"2021-12-08T18:18:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2d96b7b-301f-4b54-8f5a-542366ba6d98","html_url":"https://github.com/charlesfries/ember-cloud-firestore-adapter-pagination","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/charlesfries/ember-cloud-firestore-adapter-pagination","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlesfries%2Fember-cloud-firestore-adapter-pagination","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlesfries%2Fember-cloud-firestore-adapter-pagination/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlesfries%2Fember-cloud-firestore-adapter-pagination/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlesfries%2Fember-cloud-firestore-adapter-pagination/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charlesfries","download_url":"https://codeload.github.com/charlesfries/ember-cloud-firestore-adapter-pagination/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlesfries%2Fember-cloud-firestore-adapter-pagination/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32790639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-firestore","ember","ember-addon","ember-data","firebase","pagination"],"created_at":"2024-10-11T02:44:35.701Z","updated_at":"2026-05-08T17:36:04.180Z","avatar_url":"https://github.com/charlesfries.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ember-cloud-firestore-adapter-pagination\n==============================================================================\n\nThis addon automatically adds cursor pagination data to the `meta` object inside the `DS.PromiseArray` object returned by `store.query`.\n\n```typescript\ninterface Meta {\n  canNext: boolean;\n  canPrevious: boolean;\n}\n```\n\nIt works by checking if a `limit()` filter is included in the Cloud Firestore query. If this limit is present, the adapter fetches `LIMIT + 1` records, and depending on the presence of that extra record, `canNext` and `canPrevious` are assigned boolean values.\n\n\nCompatibility\n------------------------------------------------------------------------------\n\n* Ember.js v3.20 or above\n* Ember CLI v3.20 or above\n* Node.js v12 or above\n\n\nInstallation\n------------------------------------------------------------------------------\n\n```\nember install ember-cloud-firestore-adapter-pagination\n```\n\n\nUsage\n------------------------------------------------------------------------------\n\n```javascript\n// app/adapters/application.js\n\nimport CloudFirestoreAdapterPagination from 'ember-cloud-firestore-adapter-pagination/adapters/cloud-firestore-pagination';\n\nexport default class ApplicationAdapter extends CloudFirestoreAdapterPagination {}\n```\n\n```javascript\n// app/serializers/application.js\n\nimport CloudFirestoreSerializerPagination from 'ember-cloud-firestore-adapter-pagination/serializers/cloud-firestore-pagination';\n\nexport default class ApplicationSerializer extends CloudFirestoreSerializerPagination {}\n```\n\n```javascript\n// app/routes/application.js\n\nimport Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service store;\n\n  queryParams = {\n    startAfter: { refreshModel: true },\n    endBefore: { refreshModel: true },\n  };\n\n  model({ startAfter, endBefore }) {\n    return this.store.query('post', {\n      filter: (ref) =\u003e {\n        const PAGE_SIZE = 10;\n\n        ref = ref.orderBy('createdAt', 'desc');\n\n        if (startAfter)\n          ref = ref.startAfter(startAfter);\n        else if (endBefore)\n          ref = ref.endBefore(endBefore).limitToLast(PAGE_SIZE);\n        if (!endBefore)\n          ref = ref.limit(PAGE_SIZE);\n\n        return ref;\n      },\n    });\n  }\n}\n```\n\n```hbs\n{{! app/templates/application.js }}\n\n{{#each this.model as |post|}}\n  {{post.id}}\n{{/each}}\n\n\u003cbutton\n  type=\"button\"\n  disabled={{not this.model.meta.canPrevious}}\n  {{on \"click\" this.previous}}\u003e\n  Previous\n\u003c/button\u003e\n\n\u003cbutton\n  type=\"button\"\n  disabled={{not this.model.meta.canNext}}\n  {{on \"click\" this.next}}\u003e\n  Next\n\u003c/button\u003e\n```\n\n```javascript\n// app/controllers/application.js\n\nimport Controller from '@ember/controller';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class ApplicationController extends Controller {\n  @tracked startAfter;\n  @tracked endBefore;\n\n  @action next() {\n    this.startAfter = this.model.lastObject.createdAt;\n    this.endBefore = undefined;\n  }\n\n  @action previous() {\n    this.startAfter = undefined;\n    this.endBefore = this.model.firstObject.createdAt;\n  }\n}\n```\n\n\nContributing\n------------------------------------------------------------------------------\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n\nLicense\n------------------------------------------------------------------------------\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlesfries%2Fember-cloud-firestore-adapter-pagination","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharlesfries%2Fember-cloud-firestore-adapter-pagination","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlesfries%2Fember-cloud-firestore-adapter-pagination/lists"}