Skip to content

Commit dd47fc0

Browse files
author
vijay
committed
Merge branch 'master' of github.com:pawarvijay/react-chopper
2 parents 1020e13 + f395e6c commit dd47fc0

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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>

src/index.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff 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`.

0 commit comments

Comments
 (0)