GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - owsas/parse-loader: This is a class that helps you develop when you need to get results from a Parse backend.

This repository was archived by the owner on May 19, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
repo
repo
 
 
src
src
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
README.md
README.md
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

parse-loader

This is a class that helps you develop when you need to get results from a Parse backend.

  • parse-loader
    • Installation
    • API
      • Examples
        • Finding elements from a query in a paginated, infinite way
    • Bonus
    • LICENSE

Installation

$> npm i --save parse-loader

API

import ParseLoader from 'parse-loader';

//... let's create a Parse.Query for the example
const q = new Parse.Query('MyClass');

// ParseLoader(query, limit, skip)
const loader = new ParseLoader(q, 10, 0);


// returns the first item on the query, using ES2015 promises
loader.first(); // Promise<Parse.Object>

// returns the first item on the query, using ES2015 promises
loader.find(); // Promise<Parse.Object[]>

// restarts finding at skip 0
loader.restart(); // Promise<Parse.Object[]>

// says if you can load more (only available after first find)
loader.canLoadMore(); // boolean

// loads items infinitely from a Parse Database
loader.findNext(); // Promise<Parse.Object[]>

// loads items infinitely (backwards) from a Parse Database
loader.findPrevious(); // Promise<Parse.Object[]>

// reloads the current search
loader.reload(); // Promise<Parse.Object[]>

Examples

Finding elements from a query in a paginated, infinite way

Lets say for the example, that we are in an app where the user finds messages sent to them. In this app, when the user scrolls to the bottom of the page, the list of messages is filled with more results from the database.

Please note the example does not use any framework in specific. This works on all of them, so it doesn't matter if you use Angular, React, Ember, Aurelia ... (you name it).

import ParseLoader from 'parse-loader';

//... let's create a Parse.Query for the example
const q = new Parse.Query('MyClass');

// create the loader
const loader = new ParseLoader(q, 10, 0);

// function that triggers when the user first enters the page
function onEnter() {
    loader.findNext()
    .then(results => {
    // do something with the results...
    });
}

// when the user reloads the page somehow
function onReload(){
    loader.reload()
    .then(results => {
    // do something with the results...
    });
}

// function that executes when the user reached the bottom of the page
function onUserScrolledToTheBottom() {
    loader.findNext()
    .then(results => {
    // do something with the results...
    });
}

Bonus

  • This package has no external dependencies :D
  • #findNext takes into account if the search had any errors and repeats the same search

LICENSE

MIT
Developed by Juan Camilo Guarín Peñaranda
Otherwise SAS, Colombia, 2017

Support us on Patreon

patreon

About

This is a class that helps you develop when you need to get results from a Parse backend.

Resources

Readme
Activity
Custom properties

Stars

2 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.