ngneat / falso

All the Fake Data for All Your Real Needs 🙂

Home Page:https://ngneat.github.io/falso/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add randIncermentalNumber function

shaharkazaz opened this issue · comments

Description

A common use case in applications is showing an incremental number. We proposed the following API:

General API

const numberFactory: () => number | undefined = randIncermentalNumber({ from, to?, step: number })

Example

const numberFactory = randIncermentalNumber({ 
  from: 100, 
  to: 200,
  step: 10
});

numberFactory() // 100
numberFactory() // 110
numberFactory() // 120
...
numberFactory() // 200
numberFactory() // undefined

Proposed solution

No response

Alternatives considered

No response

Do you want to create a pull request?

No