MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / useIfAble

Function useIfAble

assets/js/block_ninja.js:301–305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

299 const cooldown = {
300 canUse,
301 useIfAble() {
302 const usable = canUse();
303 if (usable) timeRemaining += rechargeTime;
304 return usable;
305 },
306 mutate(options) {
307 if (options.rechargeTime) {
308 // Apply recharge time delta so change takes effect immediately.

Callers

nothing calls this directly

Calls 1

canUseFunction · 0.85

Tested by

no test coverage detected