Skip to content

Commit a4075e0

Browse files
committed
Support prop-dependant action configuration
1 parent 80ef8a6 commit a4075e0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/performs.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,18 @@ export default function performs(...actionKeys) {
2727

2828
constructor(props, context) {
2929
super(props, context);
30-
this.actions = mapActions(pick(this.context.getActions(), actionKeys));
30+
this.updateActions(props);
31+
}
32+
33+
componentWillReceiveProps(nextProps) {
34+
this.updateActions(nextProps);
35+
}
36+
37+
updateActions(props) {
38+
this.actions = mapActions(
39+
pick(this.context.getActions(), actionKeys),
40+
props
41+
);
3142
}
3243

3344
render() {

0 commit comments

Comments
 (0)