Make images smaller using best-in-class codecs, right in the browser.
JavaScript
Simplifying new object creation
Jake Archibald27722f77f980
diff --git a/src/components/Options/index.tsx b/src/components/Options/index.tsxindex ae75e2b9..e23c5985 100644--- a/src/components/Options/index.tsx+++ b/src/components/Options/index.tsx@@ -81,18 +81,15 @@ export default class Options extends Component<Props, State> {onPreprocessorEnabledChange(event: Event) {const el = event.currentTarget as HTMLInputElement;- const newPreprocessorState = {- ...this.props.preprocessorState,- };-- const preprocessor = el.name.split('.')[0] as keyof typeof newPreprocessorState;+ const preprocessor = el.name.split('.')[0] as keyof PreprocessorState;- newPreprocessorState[preprocessor] = {- ...newPreprocessorState[preprocessor],- enabled: el.checked,- };-- this.props.onPreprocessorOptionsChange(newPreprocessorState);+ this.props.onPreprocessorOptionsChange({+ ...this.props.preprocessorState,+ [preprocessor]: {+ ...this.props.preprocessorState[preprocessor],+ enabled: el.checked,+ },+ });}@bind