Skip to content

Commit 4e609e5

Browse files
remove trigger, getInitialState and
eventHandlerFactory props from user api by updating helper.assingAll
1 parent 1c65b6d commit 4e609e5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/utils/helper.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@ helper.getCopyState = function (state) {
1111
helper.assingAll = function (targetObj, ...sourcObjs) {
1212
// copy all enumerable and not enumerable properties into the target
1313
sourcObjs.map(sourcObj => {
14+
const enum_only = Object.keys(sourcObj);
1415
Object.getOwnPropertyNames(sourcObj).map(prop => {
15-
targetObj[prop] = sourcObj[prop];
16+
if (enum_only.indexOf(prop) >= 0)
17+
targetObj[prop] = sourcObj[prop];
18+
else
19+
Object.defineProperty(targetObj, prop, {
20+
value: sourcObj[prop],
21+
writable: true
22+
});
1623
});
1724
});
1825
return targetObj;

0 commit comments

Comments
 (0)