MCPcopy Create free account
hub / github.com/codecombat/codecombat / keepDoingUntil

Function keepDoingUntil

app/core/utils.js:732–742  ·  view source on GitHub ↗
(func, wait, totalWait)

Source from the content-addressed store, hash-verified

730
731// Call done with true to satisfy the 'until' goal and stop repeating func
732const keepDoingUntil = function (func, wait, totalWait) {
733 let done
734 if (wait == null) { wait = 100 }
735 if (totalWait == null) { totalWait = 5000 }
736 let waitSoFar = 0
737 return (done = function (success) {
738 if (((waitSoFar += wait) <= totalWait) && !success) {
739 return _.delay(() => func(done), wait)
740 }
741 })(false)
742}
743
744const grayscale = function (imageData) {
745 const d = imageData.data

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected