https://github.com/iggredible/no-mo-fun
call function no-mo' than n-times. Doesn't mean you can't have no-mo' fun!
https://github.com/iggredible/no-mo-fun
Last synced: 4 months ago
JSON representation
call function no-mo' than n-times. Doesn't mean you can't have no-mo' fun!
- Host: GitHub
- URL: https://github.com/iggredible/no-mo-fun
- Owner: iggredible
- License: mit
- Created: 2019-06-21T18:35:31.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T06:36:20.000Z (over 2 years ago)
- Last Synced: 2025-02-07T14:29:16.363Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.91 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](http://makeapullrequest.com)
[](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)Calls function no-mo' than *n* many times. *Doesn't mean you can't have no-mo' fun!*
# Installation/ Usage
`npm i noMoFun`
```
import { nTimes, once, twice, thrice } from "../noMoFun";const sayHello = function() {
console.log("Hello, you good looking person");
};
// say you want the function to execute no more than four times
const sayHelloFourTimes = nTimes(sayHello, 4);sayHelloFourTimes();
sayHelloFourTimes();
sayHelloFourTimes();
sayHelloFourTimes();
sayHelloFourTimes(); // => upon the fifth time, it will not run// Other methods for `once`, `twice`, and `thrice` are also available!
const sayHelloOnce = once(sayHello);
const sayHelloTwice = twice(sayHello);
const sayHelloThrice = thrice(sayHello);
```# Example
Check out the demo folder for an example.```
cd demo
npm i
npm run start-demo // will run on localhost:1234
```# License
[MIT](https://github.com/iggredible/no-mo-fun/blob/master/LICENSE)
___Questions and suggestions are welcome. Have fun!