रेडक्स में संबंधित कार्यकर्ताओं के साथ कई राज्यों को जोड़ने का उचित तरीका क्या है? और यह भी एक अच्छा विचार है? अगर मैं एक बेवकूफ विचार है तो मैं इसके आसपास कैसे काम कर सकता हूं?रेडक्स कनेक्ट() गुणक क्रियाओं/राज्यों के साथ
export default connect(
// which part of the Redux global state does
// our component want to receive as props?
(state) => {
return {
state: state.instagram
};
},
// which action creators does
// it want to receive by props?
(dispatch) => {
return {
actions: bindActionCreators(instagramActions, dispatch)
};
}
)(FeedContainer);
क्या मैं मूल रूप से चाहते हैं कुछ इस तरह है:
...
state: {state.instagram, state.facebook}
...
...
const mergedActions = {instagramActions, facebookActions};
actions: bindActionCreators(mergedActions , dispatch)
...
लेने के लिए और लगता है, तो आप इस के लिए वस्तु प्रसार की जरूरत है। –
हाँ मैं वाक्य रचना अद्यतन सकता है अगर – larrydahooster
चाहता था भले ही आप अपने घटक रंगमंच की सामग्री में कई कार्रवाई रचनाकारों की आवश्यकता नहीं है, यह आपके सभी घटकों भर में एक सम्मेलन से चिपक बुद्धिमान है। – AlxVallejo