{"id":20759848,"url":"https://github.com/owsas/parse-loader","last_synced_at":"2025-07-14T23:06:45.461Z","repository":{"id":91075608,"uuid":"97761045","full_name":"owsas/parse-loader","owner":"owsas","description":"This is a class that helps you develop when you need to get results from a Parse backend. ","archived":false,"fork":false,"pushed_at":"2018-04-10T19:51:45.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T16:48:58.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/owsas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2017-07-19T21:03:47.000Z","updated_at":"2021-11-01T03:48:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3e62e44-126c-4681-a158-37ccc8d05892","html_url":"https://github.com/owsas/parse-loader","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/owsas/parse-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owsas%2Fparse-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owsas%2Fparse-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owsas%2Fparse-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owsas%2Fparse-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owsas","download_url":"https://codeload.github.com/owsas/parse-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owsas%2Fparse-loader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265365635,"owners_count":23753364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-17T10:08:32.498Z","updated_at":"2025-07-14T23:06:45.444Z","avatar_url":"https://github.com/owsas.png","language":"TypeScript","funding_links":["https://patreon.com/owsas"],"categories":[],"sub_categories":[],"readme":"# parse-loader\n\nThis is a class that helps you develop when you need to get results from a Parse backend.\n\n\u003c!-- TOC --\u003e\n\n- [parse-loader](#parse-loader)\n  - [Installation](#installation)\n  - [API](#api)\n    - [Examples](#examples)\n      - [Finding elements from a query in a paginated, infinite way](#finding-elements-from-a-query-in-a-paginated-infinite-way)\n  - [Bonus](#bonus)\n  - [LICENSE](#license)\n\n\u003c!-- /TOC --\u003e\n\n## Installation\n```\n$\u003e npm i --save parse-loader\n```\n\n## API\n\n```js\nimport ParseLoader from 'parse-loader';\n\n//... let's create a Parse.Query for the example\nconst q = new Parse.Query('MyClass');\n\n// ParseLoader(query, limit, skip)\nconst loader = new ParseLoader(q, 10, 0);\n\n\n// returns the first item on the query, using ES2015 promises\nloader.first(); // Promise\u003cParse.Object\u003e\n\n// returns the first item on the query, using ES2015 promises\nloader.find(); // Promise\u003cParse.Object[]\u003e\n\n// restarts finding at skip 0\nloader.restart(); // Promise\u003cParse.Object[]\u003e\n\n// says if you can load more (only available after first find)\nloader.canLoadMore(); // boolean\n\n// loads items infinitely from a Parse Database\nloader.findNext(); // Promise\u003cParse.Object[]\u003e\n\n// loads items infinitely (backwards) from a Parse Database\nloader.findPrevious(); // Promise\u003cParse.Object[]\u003e\n\n// reloads the current search\nloader.reload(); // Promise\u003cParse.Object[]\u003e\n```\n\n### Examples\n\n#### Finding elements from a query in a paginated, infinite way\nLets say for the example, that we are in an app where the user \nfinds messages sent to them. In this app, when the user scrolls\nto the bottom of the page, the list of messages is filled with\nmore results from the database.\n\nPlease note the example does not use any framework in specific.\nThis works on all of them, so it doesn't matter if you use \nAngular, React, Ember, Aurelia ... (you name it).\n\n```js\nimport ParseLoader from 'parse-loader';\n\n//... let's create a Parse.Query for the example\nconst q = new Parse.Query('MyClass');\n\n// create the loader\nconst loader = new ParseLoader(q, 10, 0);\n\n// function that triggers when the user first enters the page\nfunction onEnter() {\n    loader.findNext()\n    .then(results =\u003e {\n    // do something with the results...\n    });\n}\n\n// when the user reloads the page somehow\nfunction onReload(){\n    loader.reload()\n    .then(results =\u003e {\n    // do something with the results...\n    });\n}\n\n// function that executes when the user reached the bottom of the page\nfunction onUserScrolledToTheBottom() {\n    loader.findNext()\n    .then(results =\u003e {\n    // do something with the results...\n    });\n}\n\n```\n\n\n## Bonus\n* This package has no external dependencies :D\n* #findNext takes into account if the search had any errors and repeats the same search\n\n## LICENSE \nMIT  \nDeveloped by Juan Camilo Guarín Peñaranda  \nOtherwise SAS, Colombia, 2017  \n\n## Support us on Patreon\n[![patreon](./repo/patreon.png)](https://patreon.com/owsas)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowsas%2Fparse-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowsas%2Fparse-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowsas%2Fparse-loader/lists"}