@lavadrop/fib
v1.0.0
Published
A Fibonacci sequence generator.
Downloads
3
Maintainers
Readme
@lavadrop/fib
Part of a library of zero-dependency npm modules that do just one thing.
- 100% TypeScript support.
- It's not a party without
Lavadrop
!
min + gzip | 99 bytes
A Fibonacci sequence generator.
Usage
import fib from '@lavadrop/fib'
const fibs = fib()
fibs.next() // { done: false, value: 0 }
fibs.next() // { done: false, value: 1 }
fibs.next() // { done: false, value: 1 }
fibs.next().value
// => 2
Parameters
none
Returns
A Fibonacci sequence iterator.
It never ends, so the result of next()
will always contain done: false
.
Return type
Generator<number, number, number>