@uppy/redux-dev-tools
Advanced tools
Comparing version 3.0.2 to 3.0.3
import { UIPlugin } from '@uppy/core'; | ||
const packageJson = { | ||
"version": "3.0.2" | ||
"version": "3.0.3" | ||
}; | ||
/* eslint-disable max-len */ | ||
/** | ||
@@ -13,5 +12,3 @@ * Add Redux DevTools support to Uppy | ||
*/ | ||
/* eslint-enable max-len */ | ||
export default class ReduxDevTools extends UIPlugin { | ||
@@ -22,7 +19,10 @@ constructor(uppy, opts) { | ||
this.id = this.opts.id || 'ReduxDevTools'; | ||
this.title = 'Redux DevTools'; // set default options | ||
this.title = 'Redux DevTools'; | ||
const defaultOptions = {}; // merge default options with the ones set by user | ||
// set default options | ||
const defaultOptions = {}; | ||
this.opts = { ...defaultOptions, | ||
// merge default options with the ones set by user | ||
this.opts = { | ||
...defaultOptions, | ||
...opts | ||
@@ -33,7 +33,5 @@ }; | ||
} | ||
handleStateChange(prevState, nextState) { | ||
this.devTools.send('UPPY_STATE_UPDATE', nextState); | ||
} | ||
initDevTools() { | ||
@@ -48,3 +46,2 @@ this.devTools = window.devToolsExtension.connect(); | ||
return; | ||
case 'IMPORT_STATE': | ||
@@ -55,3 +52,4 @@ { | ||
} = message.payload.nextLiftedState; | ||
this.uppy.store.state = { ...this.uppy.getState(), | ||
this.uppy.store.state = { | ||
...this.uppy.getState(), | ||
...computedStates[computedStates.length - 1].state | ||
@@ -62,6 +60,6 @@ }; | ||
} | ||
case 'JUMP_TO_STATE': | ||
case 'JUMP_TO_ACTION': | ||
this.uppy.store.state = { ...this.uppy.getState(), | ||
this.uppy.store.state = { | ||
...this.uppy.getState(), | ||
...JSON.parse(message.state) | ||
@@ -71,3 +69,2 @@ }; | ||
break; | ||
default: | ||
@@ -78,7 +75,5 @@ } | ||
} | ||
install() { | ||
// eslint-disable-next-line no-underscore-dangle | ||
this.withDevTools = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__; | ||
if (this.withDevTools) { | ||
@@ -89,3 +84,2 @@ this.initDevTools(); | ||
} | ||
uninstall() { | ||
@@ -97,4 +91,3 @@ if (this.withDevTools) { | ||
} | ||
} | ||
ReduxDevTools.VERSION = packageJson.version; |
{ | ||
"name": "@uppy/redux-dev-tools", | ||
"description": "Redux developer tools plugin for Uppy that simply syncs Uppy’s state with redux-devtools browser or JS extensions, and allows for basic time travel", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"license": "MIT", | ||
@@ -25,4 +25,4 @@ "main": "lib/index.js", | ||
"peerDependencies": { | ||
"@uppy/core": "^3.2.0" | ||
"@uppy/core": "^3.4.0" | ||
} | ||
} |
@@ -1,4 +0,4 @@ | ||
import type { PluginOptions, UIPlugin } from '@uppy/core' | ||
import type { UIPlugin, UIPluginOptions } from '@uppy/core' | ||
type ReduxDevToolsOptions = PluginOptions | ||
type ReduxDevToolsOptions = UIPluginOptions | ||
@@ -5,0 +5,0 @@ declare class ReduxDevTools extends UIPlugin<ReduxDevToolsOptions> {} |
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
15391
152