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

Function COUNT

examples/simple/index.js:157–175  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

155 return { count: 0 }
156 },
157 COUNT(type) {
158 let { count } = this.state
159 switch(type) {
160 case 'INCREMENT':
161 count += 1
162 break
163 case 'DECREMENT':
164 count -= 1
165 break
166 case 'INCREMENT_IF_ODD':
167 if (count % 2 === 0) {
168 return
169 }
170 count += 1
171 break
172 }
173 this.setState({ count })
174
175 },
176 componentWillMount() {
177 console.time('Wrap mount')
178 // let state = this.state

Callers 4

countingFunction · 0.85
index.jsFile · 0.85
countingFunction · 0.85
app.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected