Flux actions
"Now we need to define the actions types that we are going to refer to as constants at various places, such as sending the type from Actions to store, and in our store, deciding what action type has been passed to store to take appropriate actions.
//SocialConstants.js var keyMirror = require('keymirror'); module.exports = keyMirror({ FILTER_BY_TWEETS: null, FILTER_BY_REDDITS: null, SYNC_TWEETS: null, SYNC_REDDITS: null });
"Here, we are using the https://github.com/STRML/keyMirror package to create keys and values for the object based on the keys. This will convert into object similar to below."
{ FILTER_BY_TWEETS: 'FILTER_BY_TWEETS', … }
"This is handy when adding new keys to not repeat the same contents again."
"We can now start using the action constants. They represent four actions that we are going to perform, as follows:"
SYNC_TWEETS
: This fetches the tweets for a given userSYNC_REDDITS
: This fetches...