File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ react-chopper
44<img src =" https://raw.githubusercontent.com/pawarvijay/react-chopper/master/helicopter.svg?sanitize=true " width =" 300 " height =" 200 " />
55</h1 >
66
7- <h3 align =" center " >Code without setState</h3 >
7+ <h3 align =" center " >Create Datamodels in react</h3 >
8+ <h4 align =" center " >Code without setState</h4 >
89<h4 align =" center " >No need to remember this.setState()</h4 >
910<h4 align =" center " >No need to manage state in redux(use only for global data like global user info , global ui loader)</h4 >
1011<h4 align =" center " >No need to use other libraries for state management</h4 >
Original file line number Diff line number Diff line change @@ -34,23 +34,12 @@ export const ReactChopper = (target, componentReference) => {
3434 */
3535 const isNotAnEmptyObject = ( data ) => isObject ( data ) && Object . keys ( data ) . length > 0 ;
3636
37- /**
38- * function `isArrayOfObject`.
39- *
40- * Returns true if `data` is an array of object/objects, false otherwise.
41- */
42- const isArrayOfObject = ( data ) => {
43- let isArray = Array . isArray ( data ) ;
44- if ( isArray && data . length > 0 ) return ( data . filter ( item => isObject ( item ) ) . length === data . length ) ;
45- else return false ;
46- }
47-
4837 /**
4938 * function `isProxifiable`.
5039 *
5140 * Returns true if `data` can be isProxifiable, false otherwise.
5241 */
53- const isProxifiable = ( data ) => ( ( data instanceof Array && isArrayOfObject ( data ) ) || data instanceof Object && isNotAnEmptyObject ( data ) ) ? true : false ;
42+ const isProxifiable = ( data ) => ( ( data instanceof Array ) || data instanceof Object && isNotAnEmptyObject ( data ) ) ? true : false ;
5443
5544 /**
5645 * function `proxify`.
You can’t perform that action at this time.
0 commit comments