Skip to content

anadahalli/feathers-iterate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

feathers-iterate

Adds a .iterate() method to services in Feathers.js

.iterate() creates an async genarator for the find method on the service using given params which can be iterated using for await...of

Install

npm install feathers-iterate --save

or

yarn add feathers-iterate

Configure on server and client

const iterate = require('feathers-iterate')

app.configure(iterate())

Note: you must configure feathers-iterate before any services are registered.

Use

const genrator = app.service('messages').iterate({/* params */})

for await (let message of generator) {
  // do something with data
}

For pagination iterate uses params.query.$skip and params.query.$limit.

Next page is called when total > $limit + $skip with new skip as $limit + $skip.

About

Adds a .iterate() method to services in Feathers.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •