MCPcopy Create free account
hub / github.com/Lucifier129/react-lite / counting

Function counting

examples/simple/index.js:25–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 cancelAnimationFrame(this.rid)
24 let { COUNT } = this.props
25 let counting = () => {
26 let { count } = this.props
27 switch (true) {
28 case count > num:
29 COUNT('DECREMENT')
30 break
31 case count < num:
32 COUNT('INCREMENT')
33 break
34 case count === num:
35 return callback && callback()
36 }
37 this.rid = requestAnimationFrame(counting)
38 }
39 counting()
40 },
41 componentWillUpdate() {

Callers 1

toNumFunction · 0.70

Calls 2

COUNTFunction · 0.85
callbackFunction · 0.85

Tested by

no test coverage detected