diff --git a/src/helpers/db/db-storybook.js b/src/helpers/db/db-storybook.js new file mode 100644 index 00000000..812aff0c --- /dev/null +++ b/src/helpers/db/db-storybook.js @@ -0,0 +1,13 @@ +// @flow + +const noop = () => {} + +module.exports = { + init: noop, + get: noop, + set: noop, + getIn: noop, + setIn: noop, + cleanCache: noop, + resetAll: noop, +} diff --git a/src/helpers/db.js b/src/helpers/db/db.js similarity index 100% rename from src/helpers/db.js rename to src/helpers/db/db.js diff --git a/src/helpers/db/index.js b/src/helpers/db/index.js new file mode 100644 index 00000000..f04d4cbe --- /dev/null +++ b/src/helpers/db/index.js @@ -0,0 +1,3 @@ +const db = process.env.STORYBOOK_ENV ? require('./db-storybook') : require('./db') + +module.exports = db diff --git a/src/logger/index.js b/src/logger/index.js new file mode 100644 index 00000000..d3a015ad --- /dev/null +++ b/src/logger/index.js @@ -0,0 +1,3 @@ +const logger = process.env.STORYBOOK_ENV ? require('./logger-storybook') : require('./logger') + +module.exports = logger diff --git a/src/logger/logger-storybook.js b/src/logger/logger-storybook.js new file mode 100644 index 00000000..1fcc6163 --- /dev/null +++ b/src/logger/logger-storybook.js @@ -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, +} diff --git a/src/logger.js b/src/logger/logger.js similarity index 100% rename from src/logger.js rename to src/logger/logger.js