ungap / once

Function.prototype.once polyfill

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@ungap/once

A Function.prototype.once polyfill.

import '@ungap/once';
// require('@ungap/once');

const log = console.log.once().bind(console);

log(1); // logs 1
log(1); // does nothing

About

Function.prototype.once polyfill


Languages

Language:JavaScript 89.7%Language:HTML 10.3%