@deephaven/redux
Advanced tools
Comparing version 0.5.2-beta.0 to 0.6.0
@@ -7,33 +7,23 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
import { SET_USER, SET_WORKSPACE, SET_COMMAND_HISTORY_STORAGE, SET_WORKSPACE_STORAGE, SET_ACTIVE_TOOL, SET_FILE_STORAGE } from './actionTypes'; | ||
export var setUser = function setUser(user) { | ||
return { | ||
type: SET_USER, | ||
payload: user | ||
}; | ||
}; | ||
export var setWorkspace = function setWorkspace(workspace) { | ||
return { | ||
type: SET_WORKSPACE, | ||
payload: workspace | ||
}; | ||
}; | ||
export var setWorkspaceStorage = function setWorkspaceStorage(workspaceStorage) { | ||
return { | ||
type: SET_WORKSPACE_STORAGE, | ||
payload: workspaceStorage | ||
}; | ||
}; | ||
export var setCommandHistoryStorage = function setCommandHistoryStorage(commandHistoryStorage) { | ||
return { | ||
type: SET_COMMAND_HISTORY_STORAGE, | ||
payload: commandHistoryStorage | ||
}; | ||
}; | ||
export var setFileStorage = function setFileStorage(fileStorage) { | ||
return { | ||
type: SET_FILE_STORAGE, | ||
payload: fileStorage | ||
}; | ||
}; | ||
import { SET_USER, SET_WORKSPACE, SET_COMMAND_HISTORY_STORAGE, SET_WORKSPACE_STORAGE, SET_ACTIVE_TOOL, SET_FILE_STORAGE } from "./actionTypes.js"; | ||
export var setUser = user => ({ | ||
type: SET_USER, | ||
payload: user | ||
}); | ||
export var setWorkspace = workspace => ({ | ||
type: SET_WORKSPACE, | ||
payload: workspace | ||
}); | ||
export var setWorkspaceStorage = workspaceStorage => ({ | ||
type: SET_WORKSPACE_STORAGE, | ||
payload: workspaceStorage | ||
}); | ||
export var setCommandHistoryStorage = commandHistoryStorage => ({ | ||
type: SET_COMMAND_HISTORY_STORAGE, | ||
payload: commandHistoryStorage | ||
}); | ||
export var setFileStorage = fileStorage => ({ | ||
type: SET_FILE_STORAGE, | ||
payload: fileStorage | ||
}); | ||
/** | ||
@@ -44,12 +34,11 @@ * Sets the specified workspace locally and saves it remotely | ||
export var saveWorkspace = function saveWorkspace(workspace) { | ||
return function (dispatch, getState) { | ||
dispatch(setWorkspace(workspace)); | ||
var _getState = getState(), | ||
storage = _getState.storage; | ||
var workspaceStorage = storage.workspaceStorage; | ||
return workspaceStorage.save(workspace); | ||
}; | ||
export var saveWorkspace = workspace => (dispatch, getState) => { | ||
dispatch(setWorkspace(workspace)); | ||
var { | ||
storage | ||
} = getState(); | ||
var { | ||
workspaceStorage | ||
} = storage; | ||
return workspaceStorage.save(workspace); | ||
}; | ||
@@ -61,15 +50,15 @@ /** | ||
export var updateWorkspaceData = function updateWorkspaceData(workspaceData) { | ||
return function (dispatch, getState) { | ||
var _getState2 = getState(), | ||
workspace = _getState2.workspace; | ||
export var updateWorkspaceData = workspaceData => (dispatch, getState) => { | ||
var { | ||
workspace | ||
} = getState(); | ||
var { | ||
data | ||
} = workspace; | ||
var data = workspace.data; | ||
var newWorkspace = _objectSpread(_objectSpread({}, workspace), {}, { | ||
data: _objectSpread(_objectSpread({}, data), workspaceData) | ||
}); | ||
var newWorkspace = _objectSpread(_objectSpread({}, workspace), {}, { | ||
data: _objectSpread(_objectSpread({}, data), workspaceData) | ||
}); | ||
return dispatch(saveWorkspace(newWorkspace)); | ||
}; | ||
return dispatch(saveWorkspace(newWorkspace)); | ||
}; | ||
@@ -81,15 +70,9 @@ /** | ||
export var saveSettings = function saveSettings(settings) { | ||
return function (dispatch) { | ||
return dispatch(updateWorkspaceData({ | ||
settings: settings | ||
})); | ||
}; | ||
}; | ||
export var setActiveTool = function setActiveTool(payload) { | ||
return { | ||
type: SET_ACTIVE_TOOL, | ||
payload: payload | ||
}; | ||
}; | ||
export var saveSettings = settings => dispatch => dispatch(updateWorkspaceData({ | ||
settings | ||
})); | ||
export var setActiveTool = payload => ({ | ||
type: SET_ACTIVE_TOOL, | ||
payload | ||
}); | ||
//# sourceMappingURL=actions.js.map |
@@ -1,7 +0,7 @@ | ||
export * from './selectors'; | ||
export * from './actions'; | ||
export * from './reducers/common'; | ||
export { default as reducers } from './reducers'; | ||
export { default as reducerRegistry } from './reducerRegistry'; | ||
export { default as store } from './store'; | ||
export * from "./selectors.js"; | ||
export * from "./actions.js"; | ||
export * from "./reducers/common/index.js"; | ||
export { default as reducers } from "./reducers/index.js"; | ||
export { default as reducerRegistry } from "./reducerRegistry.js"; | ||
export { default as store } from "./store.js"; | ||
//# sourceMappingURL=index.js.map |
import Log from '@deephaven/log'; | ||
var log = Log.module('redux-crashReporter'); | ||
var crashReporter = function crashReporter(store) { | ||
return function (next) { | ||
return function (action) { | ||
try { | ||
return next(action); | ||
} catch (err) { | ||
log.error('Error executing', action, ' with state ', store.getState(), ':', err); | ||
throw err; | ||
} | ||
}; | ||
}; | ||
var crashReporter = store => next => action => { | ||
try { | ||
return next(action); | ||
} catch (err) { | ||
log.error('Error executing', action, ' with state ', store.getState(), ':', err); | ||
throw err; | ||
} | ||
}; | ||
@@ -16,0 +12,0 @@ |
@@ -1,5 +0,5 @@ | ||
declare var _default: (((store: any) => (next: any) => (action: any) => any) | (import("redux-thunk").ThunkMiddleware<{}, import("redux").AnyAction, undefined> & { | ||
withExtraArgument<E>(extraArgument: E): import("redux-thunk").ThunkMiddleware<{}, import("redux").AnyAction, E>; | ||
declare var _default: (((store: any) => (next: any) => (action: any) => any) | (import("redux-thunk").ThunkMiddleware<any, import("redux").AnyAction, undefined> & { | ||
withExtraArgument<ExtraThunkArg, State = any, BasicAction extends import("redux").Action<any> = import("redux").AnyAction>(extraArgument: ExtraThunkArg): import("redux-thunk").ThunkMiddleware<State, BasicAction, ExtraThunkArg>; | ||
}))[]; | ||
export default _default; | ||
//# sourceMappingURL=index.d.ts.map |
import thunk from 'redux-thunk'; | ||
import logger from './logger'; | ||
import crashReporter from './crashReporter'; | ||
import logger from "./logger.js"; | ||
import crashReporter from "./crashReporter.js"; | ||
export default [logger, crashReporter, thunk]; | ||
//# sourceMappingURL=index.js.map |
import Log from '@deephaven/log'; | ||
var log = Log.module('redux-logger'); | ||
var logger = function logger(store) { | ||
return function (next) { | ||
return function (action) { | ||
log.debug('dispatching', action); | ||
var result = next(action); | ||
log.debug('next state', store.getState()); | ||
return result; | ||
}; | ||
}; | ||
var logger = store => next => action => { | ||
log.debug('dispatching', action); | ||
var result = next(action); | ||
log.debug('next state', store.getState()); | ||
return result; | ||
}; | ||
@@ -14,0 +10,0 @@ |
@@ -5,8 +5,2 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
@@ -21,6 +15,4 @@ | ||
*/ | ||
export var ReducerRegistry = /*#__PURE__*/function () { | ||
function ReducerRegistry() { | ||
_classCallCheck(this, ReducerRegistry); | ||
export class ReducerRegistry { | ||
constructor() { | ||
_defineProperty(this, "reducers", {}); | ||
@@ -31,21 +23,18 @@ | ||
_createClass(ReducerRegistry, [{ | ||
key: "register", | ||
value: function register(name, reducer) { | ||
var _this$listener; | ||
register(name, reducer) { | ||
var _this$listener; | ||
this.reducers = _objectSpread(_objectSpread({}, this.reducers), {}, _defineProperty({}, name, reducer)); | ||
(_this$listener = this.listener) === null || _this$listener === void 0 ? void 0 : _this$listener.call(this, this.reducers); | ||
} | ||
}, { | ||
key: "setListener", | ||
value: function setListener(listener) { | ||
this.listener = listener; | ||
} | ||
}]); | ||
this.reducers = _objectSpread(_objectSpread({}, this.reducers), {}, { | ||
[name]: reducer | ||
}); | ||
(_this$listener = this.listener) === null || _this$listener === void 0 ? void 0 : _this$listener.call(this, this.reducers); | ||
} | ||
return ReducerRegistry; | ||
}(); | ||
setListener(listener) { | ||
this.listener = listener; | ||
} | ||
} | ||
var reducerRegistry = new ReducerRegistry(); | ||
export default reducerRegistry; | ||
//# sourceMappingURL=reducerRegistry.js.map |
/** | ||
* The active tool the user currently has selected | ||
*/ | ||
import { SET_ACTIVE_TOOL } from '../actionTypes'; | ||
import { replaceReducer } from './common'; | ||
import { SET_ACTIVE_TOOL } from "../actionTypes.js"; | ||
import { replaceReducer } from "./common/index.js"; | ||
export default replaceReducer(SET_ACTIVE_TOOL, null); | ||
//# sourceMappingURL=activeTool.js.map |
@@ -1,4 +0,4 @@ | ||
export { default as mergeReducer } from './mergeReducer'; | ||
export { default as replaceByIdReducer } from './replaceByIdReducer'; | ||
export { default as replaceReducer } from './replaceReducer'; | ||
export { default as mergeReducer } from "./mergeReducer.js"; | ||
export { default as replaceByIdReducer } from "./replaceByIdReducer.js"; | ||
export { default as replaceReducer } from "./replaceReducer.js"; | ||
//# sourceMappingURL=index.js.map |
@@ -13,28 +13,26 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
*/ | ||
export default (function (type, initialState) { | ||
return function () { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
export default ((type, initialState) => function () { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
switch (action.type) { | ||
case type: | ||
{ | ||
var newState = action.payload; | ||
switch (action.type) { | ||
case type: | ||
{ | ||
var newState = action.payload; | ||
if (newState == null) { | ||
return null; | ||
} | ||
if (newState == null) { | ||
return null; | ||
} | ||
if (state != null) { | ||
return _objectSpread(_objectSpread({}, state), newState); | ||
} | ||
return _objectSpread({}, newState); | ||
if (state != null) { | ||
return _objectSpread(_objectSpread({}, state), newState); | ||
} | ||
default: | ||
return state; | ||
} | ||
}; | ||
return _objectSpread({}, newState); | ||
} | ||
default: | ||
return state; | ||
} | ||
}); | ||
//# sourceMappingURL=mergeReducer.js.map |
@@ -24,7 +24,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
{ | ||
var id = action.id, | ||
payload = action.payload; | ||
var { | ||
id, | ||
payload | ||
} = action; | ||
if (checkIfChanged && deepEqual({ | ||
payload: payload | ||
payload | ||
}, { | ||
@@ -36,3 +38,5 @@ payload: state[id] | ||
return _objectSpread(_objectSpread({}, state), {}, _defineProperty({}, id, payload)); | ||
return _objectSpread(_objectSpread({}, state), {}, { | ||
[id]: payload | ||
}); | ||
} | ||
@@ -39,0 +43,0 @@ |
@@ -7,18 +7,16 @@ /** | ||
*/ | ||
export default (function (type, initialState) { | ||
return function () { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
export default ((type, initialState) => function () { | ||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
switch (action.type) { | ||
case type: | ||
{ | ||
return action.payload; | ||
} | ||
switch (action.type) { | ||
case type: | ||
{ | ||
return action.payload; | ||
} | ||
default: | ||
return state; | ||
} | ||
}; | ||
default: | ||
return state; | ||
} | ||
}); | ||
//# sourceMappingURL=replaceReducer.js.map |
@@ -1,12 +0,12 @@ | ||
import activeTool from './activeTool'; | ||
import storage from './storage'; | ||
import user from './user'; | ||
import workspace from './workspace'; | ||
import activeTool from "./activeTool.js"; | ||
import storage from "./storage/index.js"; | ||
import user from "./user.js"; | ||
import workspace from "./workspace.js"; | ||
var reducers = { | ||
activeTool: activeTool, | ||
storage: storage, | ||
user: user, | ||
workspace: workspace | ||
activeTool, | ||
storage, | ||
user, | ||
workspace | ||
}; | ||
export default reducers; | ||
//# sourceMappingURL=index.js.map |
@@ -5,5 +5,5 @@ /** | ||
*/ | ||
import { SET_COMMAND_HISTORY_STORAGE } from '../../actionTypes'; | ||
import { replaceReducer } from '../common'; | ||
import { SET_COMMAND_HISTORY_STORAGE } from "../../actionTypes.js"; | ||
import { replaceReducer } from "../common/index.js"; | ||
export default replaceReducer(SET_COMMAND_HISTORY_STORAGE, null); | ||
//# sourceMappingURL=commandHistoryStorage.js.map |
@@ -5,5 +5,5 @@ /** | ||
*/ | ||
import { SET_FILE_STORAGE } from '../../actionTypes'; | ||
import { replaceReducer } from '../common'; | ||
import { SET_FILE_STORAGE } from "../../actionTypes.js"; | ||
import { replaceReducer } from "../common/index.js"; | ||
export default replaceReducer(SET_FILE_STORAGE, null); | ||
//# sourceMappingURL=fileStorage.js.map |
import { combineReducers } from 'redux'; | ||
import commandHistoryStorage from './commandHistoryStorage'; | ||
import fileStorage from './fileStorage'; | ||
import workspaceStorage from './workspaceStorage'; | ||
import commandHistoryStorage from "./commandHistoryStorage.js"; | ||
import fileStorage from "./fileStorage.js"; | ||
import workspaceStorage from "./workspaceStorage.js"; | ||
export default combineReducers({ | ||
commandHistoryStorage: commandHistoryStorage, | ||
fileStorage: fileStorage, | ||
workspaceStorage: workspaceStorage | ||
commandHistoryStorage, | ||
fileStorage, | ||
workspaceStorage | ||
}); | ||
//# sourceMappingURL=index.js.map |
@@ -5,5 +5,5 @@ /** | ||
*/ | ||
import { SET_WORKSPACE_STORAGE } from '../../actionTypes'; | ||
import { replaceReducer } from '../common'; | ||
import { SET_WORKSPACE_STORAGE } from "../../actionTypes.js"; | ||
import { replaceReducer } from "../common/index.js"; | ||
export default replaceReducer(SET_WORKSPACE_STORAGE, null); | ||
//# sourceMappingURL=workspaceStorage.js.map |
/** | ||
* Store information about the current user. | ||
*/ | ||
import { SET_USER } from '../actionTypes'; | ||
import { mergeReducer } from './common'; | ||
import { SET_USER } from "../actionTypes.js"; | ||
import { mergeReducer } from "./common/index.js"; | ||
export default mergeReducer(SET_USER, null); | ||
//# sourceMappingURL=user.js.map |
@@ -6,5 +6,5 @@ /** | ||
*/ | ||
import { SET_WORKSPACE } from '../actionTypes'; | ||
import { mergeReducer } from './common'; | ||
import { SET_WORKSPACE } from "../actionTypes.js"; | ||
import { mergeReducer } from "./common/index.js"; | ||
export default mergeReducer(SET_WORKSPACE, null); | ||
//# sourceMappingURL=workspace.js.map |
@@ -5,5 +5,5 @@ /** | ||
*/ | ||
import { SET_WORKSPACE_STORAGE } from '../actionTypes'; | ||
import { replaceReducer } from './common'; | ||
import { SET_WORKSPACE_STORAGE } from "../actionTypes.js"; | ||
import { replaceReducer } from "./common/index.js"; | ||
export default replaceReducer(SET_WORKSPACE_STORAGE, null); | ||
//# sourceMappingURL=workspaceStorage.js.map |
// User | ||
export var getUser = function getUser(store) { | ||
return store.user; | ||
}; | ||
export var getUserName = function getUserName(store) { | ||
return getUser(store).name; | ||
}; | ||
export var getUserGroups = function getUserGroups(store) { | ||
return getUserGroups(store).groups; | ||
}; // Storage | ||
export var getUser = store => store.user; | ||
export var getUserName = store => getUser(store).name; | ||
export var getUserGroups = store => getUserGroups(store).groups; // Storage | ||
export var getStorage = function getStorage(store) { | ||
return store.storage; | ||
}; | ||
export var getCommandHistoryStorage = function getCommandHistoryStorage(store) { | ||
return getStorage(store).commandHistoryStorage; | ||
}; | ||
export var getFileStorage = function getFileStorage(store) { | ||
return getStorage(store).fileStorage; | ||
}; | ||
export var getWorkspaceStorage = function getWorkspaceStorage(store) { | ||
return getStorage(store).workspaceStorage; | ||
}; // Workspace | ||
export var getStorage = store => store.storage; | ||
export var getCommandHistoryStorage = store => getStorage(store).commandHistoryStorage; | ||
export var getFileStorage = store => getStorage(store).fileStorage; | ||
export var getWorkspaceStorage = store => getStorage(store).workspaceStorage; // Workspace | ||
export var getWorkspace = function getWorkspace(store) { | ||
return store.workspace; | ||
}; // Settings | ||
export var getWorkspace = store => store.workspace; // Settings | ||
export var getSettings = function getSettings(store) { | ||
return getWorkspace(store).data.settings; | ||
}; | ||
export var getDefaultDateTimeFormat = function getDefaultDateTimeFormat(store) { | ||
return getSettings(store).defaultDateTimeFormat; | ||
}; | ||
export var getFormatter = function getFormatter(store) { | ||
return getSettings(store).formatter; | ||
}; | ||
export var getTimeZone = function getTimeZone(store) { | ||
return getSettings(store).timeZone; | ||
}; | ||
export var getShowTimeZone = function getShowTimeZone(store) { | ||
return getSettings(store).showTimeZone; | ||
}; | ||
export var getShowTSeparator = function getShowTSeparator(store) { | ||
return getSettings(store).showTSeparator; | ||
}; | ||
export var getDisableMoveConfirmation = function getDisableMoveConfirmation(store) { | ||
return getSettings(store).disableMoveConfirmation || false; | ||
}; | ||
export var getShowSystemBadge = function getShowSystemBadge(store) { | ||
return getSettings(store).showSystemBadge; | ||
}; | ||
export var getActiveTool = function getActiveTool(store) { | ||
return store.activeTool; | ||
}; | ||
export var getSettings = store => getWorkspace(store).data.settings; | ||
export var getDefaultDateTimeFormat = store => getSettings(store).defaultDateTimeFormat; | ||
export var getFormatter = store => getSettings(store).formatter; | ||
export var getTimeZone = store => getSettings(store).timeZone; | ||
export var getShowTimeZone = store => getSettings(store).showTimeZone; | ||
export var getShowTSeparator = store => getSettings(store).showTSeparator; | ||
export var getDisableMoveConfirmation = store => getSettings(store).disableMoveConfirmation || false; | ||
export var getShowSystemBadge = store => getSettings(store).showSystemBadge; | ||
export var getActiveTool = store => store.activeTool; | ||
//# sourceMappingURL=selectors.js.map |
@@ -1,31 +0,8 @@ | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
import { applyMiddleware, createStore, compose, combineReducers } from 'redux'; | ||
import rootMiddleware from './middleware'; | ||
import reducers from './reducers'; | ||
import reducerRegistry from './reducerRegistry'; // TODO #70: Separate all reducers into their respective modules, register from there | ||
import rootMiddleware from "./middleware/index.js"; | ||
import reducers from "./reducers/index.js"; | ||
import reducerRegistry from "./reducerRegistry.js"; // TODO #70: Separate all reducers into their respective modules, register from there | ||
Object.entries(reducers).map(function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
name = _ref2[0], | ||
reducer = _ref2[1]; | ||
Object.entries(reducers).map((_ref) => { | ||
var [name, reducer] = _ref; | ||
return reducerRegistry.register(name, reducer); | ||
@@ -36,4 +13,4 @@ }); | ||
var composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; | ||
var store = createStore(combineReducers(reducerRegistry.reducers), composeEnhancers(applyMiddleware.apply(void 0, _toConsumableArray(rootMiddleware)))); | ||
reducerRegistry.setListener(function (newReducers) { | ||
var store = createStore(combineReducers(reducerRegistry.reducers), composeEnhancers(applyMiddleware(...rootMiddleware))); | ||
reducerRegistry.setListener(newReducers => { | ||
store.replaceReducer(combineReducers(newReducers)); | ||
@@ -40,0 +17,0 @@ }); |
{ | ||
"name": "@deephaven/redux", | ||
"version": "0.5.2-beta.0+0936be9", | ||
"version": "0.6.0", | ||
"description": "Deephaven Redux", | ||
"author": "Deephaven Data Labs LLC", | ||
"license": "Apache-2.0", | ||
"type": "module", | ||
"repository": { | ||
@@ -41,4 +42,4 @@ "type": "git", | ||
"@babel/core": "7.12.3", | ||
"@deephaven/log": "^0.5.2-beta.0+0936be9", | ||
"@deephaven/tsconfig": "^0.5.2-beta.0+0936be9", | ||
"@deephaven/log": "^0.6.0", | ||
"@deephaven/tsconfig": "^0.6.0", | ||
"babel-loader": "8.1.0", | ||
@@ -52,3 +53,3 @@ "cross-env": "^7.0.2", | ||
"peerDependencies": { | ||
"@deephaven/log": "^0.1.0", | ||
"@deephaven/log": "^0.3.1", | ||
"redux": "^4.0.5" | ||
@@ -62,3 +63,3 @@ }, | ||
}, | ||
"gitHead": "0936be95c2308353398af459d9e661a733f1ffde" | ||
"gitHead": "126e214ebbfe40b45113349c66913c65fc2236fd" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
0
Yes
101636
452