orionsoft-react-scripts
Version:
Orionsoft Configuration and scripts for Create React App.
53 lines (28 loc) • 892 B
Markdown
return the return value from the first call.
*Unlike the module [once](https://github.com/isaacs/once), this one isn't naughty extending `Function.prototype`.*
```
$ npm install --save onetime
```
```js
let i = 0;
const foo = onetime(() => i++);
foo(); //=> 0
foo(); //=> 0
foo(); //=> 0
```
Type: `function`
Function that should only be called once.
Type: `boolean`
Default: `false`

Set to `true` if you want it to fail with a nice and descriptive error when called more than once.
MIT © [Sindre Sorhus](http://sindresorhus.com)
> Only call a function once
When called multiple times it will