https://github.com/elsehow/kefir-takenth
take every nth element of a kefir stream
https://github.com/elsehow/kefir-takenth
Last synced: about 1 year ago
JSON representation
take every nth element of a kefir stream
- Host: GitHub
- URL: https://github.com/elsehow/kefir-takenth
- Owner: elsehow
- Created: 2015-10-11T23:14:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-12T16:01:43.000Z (over 10 years ago)
- Last Synced: 2025-03-20T03:49:00.484Z (about 1 year ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kefir-takenth
take every nth element of a [kefir](https://rpominov.github.io/kefir/) stream!
## installation
`npm install kefir-takenth`
## usage
```javascript
var Kefir = require('kefir')
var takeNth = require('kefir-takenth')
var a = Kefir.sequentially(1, ['a','b','c','d','e','f'])
takeNth(a, 3).log()
> c
> f
```
## API
### takeNth(stream, n)
returns a kefir stream of every `n`th element from `stream`