Browse Source
Make logger && db env dependent - fixes storybook
master
meriadec
7 years ago
No known key found for this signature in database
GPG Key ID: 1D2FC2305E2CB399
6 changed files with
42 additions and
0 deletions
-
src/helpers/db/db-storybook.js
-
src/helpers/db/db.js
-
src/helpers/db/index.js
-
src/logger/index.js
-
src/logger/logger-storybook.js
-
src/logger/logger.js
|
|
@ -0,0 +1,13 @@ |
|
|
|
// @flow
|
|
|
|
|
|
|
|
const noop = () => {} |
|
|
|
|
|
|
|
module.exports = { |
|
|
|
init: noop, |
|
|
|
get: noop, |
|
|
|
set: noop, |
|
|
|
getIn: noop, |
|
|
|
setIn: noop, |
|
|
|
cleanCache: noop, |
|
|
|
resetAll: noop, |
|
|
|
} |
|
|
@ -0,0 +1,3 @@ |
|
|
|
const db = process.env.STORYBOOK_ENV ? require('./db-storybook') : require('./db') |
|
|
|
|
|
|
|
module.exports = db |
|
|
@ -0,0 +1,3 @@ |
|
|
|
const logger = process.env.STORYBOOK_ENV ? require('./logger-storybook') : require('./logger') |
|
|
|
|
|
|
|
module.exports = logger |
|
|
@ -0,0 +1,23 @@ |
|
|
|
const noop = () => {} |
|
|
|
|
|
|
|
module.exports = { |
|
|
|
setProcessShortName: noop, |
|
|
|
onCmd: noop, |
|
|
|
onDB: noop, |
|
|
|
onReduxAction: noop, |
|
|
|
onTabKey: noop, |
|
|
|
websocket: noop, |
|
|
|
libcore: noop, |
|
|
|
network: noop, |
|
|
|
networkSucceed: noop, |
|
|
|
networkError: noop, |
|
|
|
networkDown: noop, |
|
|
|
analyticsStart: noop, |
|
|
|
analyticsStop: noop, |
|
|
|
analyticsTrack: noop, |
|
|
|
analyticsPage: noop, |
|
|
|
log: noop, |
|
|
|
warn: noop, |
|
|
|
error: noop, |
|
|
|
critical: noop, |
|
|
|
} |