Skip to content

Commit

Permalink
Enable support for Mozilla Addons (reduxjs#2030)
Browse files Browse the repository at this point in the history
  • Loading branch information
qzb authored and seantcoyote committed Jan 14, 2018
1 parent b099db6 commit d41380e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"lodash": "^4.2.1",
"lodash-es": "^4.2.1",
"loose-envify": "^1.1.0",
"symbol-observable": "^1.0.2"
"symbol-observable": "^1.0.3"
},
"devDependencies": {
"babel-cli": "^6.3.15",
Expand Down
8 changes: 5 additions & 3 deletions src/combineReducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { ActionTypes } from './createStore'
import isPlainObject from 'lodash/isPlainObject'
import warning from './utils/warning'

var NODE_ENV = typeof process !== 'undefined' ? process.env.NODE_ENV : 'development'

function getUndefinedStateErrorMessage(key, action) {
var actionType = action && action.type
var actionName = actionType && `"${actionType.toString()}"` || 'an action'
Expand Down Expand Up @@ -103,7 +105,7 @@ export default function combineReducers(reducers) {
for (var i = 0; i < reducerKeys.length; i++) {
var key = reducerKeys[i]

if (process.env.NODE_ENV !== 'production') {
if (NODE_ENV !== 'production') {
if (typeof reducers[key] === 'undefined') {
warning(`No reducer provided for key "${key}"`)
}
Expand All @@ -115,7 +117,7 @@ export default function combineReducers(reducers) {
}
var finalReducerKeys = Object.keys(finalReducers)

if (process.env.NODE_ENV !== 'production') {
if (NODE_ENV !== 'production') {
var unexpectedKeyCache = {}
}

Expand All @@ -131,7 +133,7 @@ export default function combineReducers(reducers) {
throw sanityError
}

if (process.env.NODE_ENV !== 'production') {
if (NODE_ENV !== 'production') {
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache)
if (warningMessage) {
warning(warningMessage)
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import warning from './utils/warning'
function isCrushed() {}

if (
typeof process !== 'undefined' &&
process.env.NODE_ENV !== 'production' &&
typeof isCrushed.name === 'string' &&
isCrushed.name !== 'isCrushed'
Expand Down

0 comments on commit d41380e

Please sign in to comment.