This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// approach 1: define action object in the component | |
this.props.dispatch({ | |
type : "EDIT_ITEM_ATTRIBUTES", | |
payload : { | |
item : {itemID, itemType}, | |
newAttributes : newValue, | |
} | |
}); | |
// approach 2: use an action creator function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example: | |
function myCallback() { | |
// cool stuff here | |
} | |
// don't invoke the function here with () i.e. myCallback(), just reference the name of it it - myCallback. | |
JavaScript.load("/javascripts/something.js", myCallback); | |
// With callback (that’s the good thing): |