Answer the question
In order to leave comments, you need to log in
Why are flux constants assigned null?
Constants created with "keyMirror" are set to null
var keyMirror = require('react/lib/keyMirror');
// Define action constants
module.exports = keyMirror({
CART_ADD: null,
CART_REMOVE: null,
CART_VISIBLE: null,
SET_SELECTED: null,
RECEIVE_DATA: null
});
Answer the question
In order to leave comments, you need to log in
This function returns an object where all keys have the name of the key as their value, so this can be represented as
// Define action constants
module.exports = {
CART_ADD: "CART_ADD",
CART_REMOVE: "CART_REMOVE",
CART_VISIBLE: "CART_VISIBLE",
SET_SELECTED: "SET_SELECTED",
RECEIVE_DATA: "RECEIVE_DATA"
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question