@@ -52,8 +52,6 @@ const actions = (viewObject) => {
52
52
const getState = ( ) => viewObject . actions . state ;
53
53
54
54
const setState = ( newState = { } , callback = null , updateView = true ) => {
55
- console . log ( 'Setting new state...' ) ;
56
-
57
55
let state = newState ;
58
56
let shouldComponentUpdate = true ;
59
57
@@ -63,7 +61,6 @@ const actions = (viewObject) => {
63
61
64
62
viewObject . actions . state = defaultsDeepPreserveArrays ( state , viewObject . actions . state ) ;
65
63
66
- console . log ( 'shouldComponentUpdate' ) ;
67
64
if ( isFunction ( viewObject . actions . shouldComponentUpdate ) ) {
68
65
shouldComponentUpdate = ! ! viewObject . actions . shouldComponentUpdate ( viewObject . actions . state , viewObject . actions ) ;
69
66
} else {
@@ -72,7 +69,6 @@ const actions = (viewObject) => {
72
69
73
70
if ( shouldComponentUpdate ) {
74
71
if ( updateView ) {
75
- console . log ( 'componentWillUpdate' ) ;
76
72
if ( viewObject . actions . componentWillUpdate ) {
77
73
if ( isFunction ( viewObject . actions . componentWillUpdate ) ) {
78
74
viewObject . actions . componentWillUpdate ( viewObject . actions . state , viewObject . actions , viewObject ) ;
@@ -81,7 +77,6 @@ const actions = (viewObject) => {
81
77
82
78
viewObject . nodes . view = patch ( viewObject . nodes . view , viewObject . component . getViewComponent ( viewObject . actions . state ) ) ;
83
79
84
- console . log ( 'componentDidUpdate' ) ;
85
80
if ( viewObject . actions . componentDidUpdate ) {
86
81
if ( isFunction ( viewObject . actions . componentDidUpdate ) ) {
87
82
viewObject . actions . componentDidUpdate ( viewObject . actions . state , viewObject . actions ) ;
@@ -116,8 +111,6 @@ const actions = (viewObject) => {
116
111
117
112
return viewObject . actions . reducer ( prevState , nextAction , viewObject . actions ) ;
118
113
} ) ;
119
- } else {
120
- console . error ( 'Please provide reducer function to use this functionality!' ) ;
121
114
}
122
115
} ;
123
116
@@ -159,8 +152,6 @@ const actions = (viewObject) => {
159
152
160
153
const componentFn = ( viewObject ) => {
161
154
const getViewComponent = ( newState ) => {
162
- console . log ( 'Getting view...' ) ;
163
-
164
155
if ( viewObject . actions . render && isFunction ( viewObject . actions . render ) ) {
165
156
let node = null ;
166
157
@@ -176,12 +167,7 @@ const componentFn = (viewObject) => {
176
167
return h ( 'div' , 'Nothing to render' ) ;
177
168
} ;
178
169
179
- const getViewContext = ( ) => {
180
- console . log ( 'Finding view context...' ) ;
181
-
182
- console . log ( 'View context found: `render()` result' ) ;
183
- return getViewComponent ( viewObject . actions . state ) ;
184
- } ;
170
+ const getViewContext = ( ) => getViewComponent ( viewObject . actions . state ) ;
185
171
186
172
const profileHook = ( hook ) => {
187
173
const types = uniq ( map ( hook , ( hk ) => {
@@ -295,7 +281,6 @@ const createComponent = (params = defaultParams) => {
295
281
params . state = isFunction ( params . state ) ? params . state ( params ) : params . state ;
296
282
297
283
if ( params . componentWillCreateViewObject && isFunction ( params . componentWillCreateViewObject ) ) {
298
- console . log ( 'componentWillCreateViewObject' ) ;
299
284
params . componentWillCreateViewObject ( params . state ) ;
300
285
}
301
286
@@ -313,7 +298,6 @@ const createComponent = (params = defaultParams) => {
313
298
viewObject . component = componentFn ( viewObject ) ;
314
299
315
300
if ( viewObject . actions . componentWillInit && isFunction ( viewObject . actions . componentWillInit ) ) {
316
- console . log ( 'componentWillInit' ) ;
317
301
viewObject . actions . componentWillInit ( viewObject . actions . state , viewObject . actions ) ;
318
302
}
319
303
@@ -326,43 +310,36 @@ const createComponent = (params = defaultParams) => {
326
310
...viewObject . nodes . view . data ,
327
311
hook : {
328
312
init : ( ) => {
329
- console . log ( 'init' ) ;
330
313
if ( viewObject . actions . componentDidInit && isFunction ( viewObject . actions . componentDidInit ) ) {
331
314
viewObject . actions . componentDidInit ( viewObject . actions . state , viewObject . actions ) ;
332
315
}
333
316
} ,
334
317
create : ( ) => {
335
- console . log ( 'componentWillMount' ) ;
336
318
if ( viewObject . actions . componentWillMount && isFunction ( viewObject . actions . componentWillMount ) ) {
337
319
viewObject . actions . componentWillMount ( viewObject . actions . state , viewObject . actions ) ;
338
320
}
339
321
} ,
340
322
prepatch : ( ) => {
341
- console . log ( 'prepatch' ) ;
342
323
if ( viewObject . actions . componentWillPrepatch && isFunction ( viewObject . actions . componentWillPrepatch ) ) {
343
324
viewObject . actions . componentWillPrepatch ( viewObject . actions . state , viewObject . actions ) ;
344
325
}
345
326
} ,
346
327
postpatch : ( ) => {
347
- console . log ( 'postpatch' ) ;
348
328
if ( viewObject . actions . componentWillPostpatch && isFunction ( viewObject . actions . componentWillPostpatch ) ) {
349
329
viewObject . actions . componentWillPostpatch ( viewObject . actions . state , viewObject . actions ) ;
350
330
}
351
331
} ,
352
332
insert : ( ) => {
353
- console . log ( 'componentDidMount' ) ;
354
333
if ( viewObject . actions . componentDidMount && isFunction ( viewObject . actions . componentDidMount ) ) {
355
334
viewObject . actions . componentDidMount ( viewObject . actions . state , viewObject . actions ) ;
356
335
}
357
336
} ,
358
337
destroy : ( ) => {
359
- console . log ( 'componentWillUnmount' ) ;
360
338
if ( viewObject . actions . componentWillUnmount && isFunction ( viewObject . actions . componentWillUnmount ) ) {
361
339
viewObject . actions . componentWillUnmount ( viewObject . actions . state , viewObject . actions ) ;
362
340
}
363
341
} ,
364
342
remove : ( vnode , removeCallback ) => {
365
- console . log ( 'componentDidUnmount' ) ;
366
343
if ( viewObject . actions . componentDidUnmount && isFunction ( viewObject . actions . componentDidUnmount ) ) {
367
344
viewObject . actions . componentDidUnmount ( viewObject . actions . state , viewObject . actions ) ;
368
345
}
@@ -373,7 +350,6 @@ const createComponent = (params = defaultParams) => {
373
350
} ;
374
351
375
352
if ( viewObject . actions . componentDidCreateViewObject && isFunction ( viewObject . actions . componentDidCreateViewObject ) ) {
376
- console . log ( 'componentDidCreateViewObject' ) ;
377
353
viewObject . actions . componentDidCreateViewObject ( viewObject . actions . state , viewObject . actions ) ;
378
354
}
379
355
0 commit comments