1+ import PropTypes from 'prop-types' ;
2+ import PubSub from 'pubsub-js' ;
3+ import React from 'react' ;
4+ import createSagaMiddleware from 'redux-saga' ;
5+ import { Provider , connect } from 'react-redux' ;
6+ import {
7+ createStore ,
8+ applyMiddleware ,
9+ compose ,
10+ } from 'redux' ;
11+ import { enableBatching } from 'redux-batched-actions' ;
12+ import { createRoot } from 'react-dom/client' ;
113import * as LocalStorage from './components/LocalStorage' ;
214import ASTOutputContainer from './containers/ASTOutputContainer' ;
315import CodeEditorContainer from './containers/CodeEditorContainer' ;
416import ErrorMessageContainer from './containers/ErrorMessageContainer' ;
517import GistBanner from './components/GistBanner' ;
618import LoadingIndicatorContainer from './containers/LoadingIndicatorContainer' ;
719import PasteDropTargetContainer from './containers/PasteDropTargetContainer' ;
8- import PropTypes from 'prop-types' ;
9- import PubSub from 'pubsub-js' ;
10- import React from 'react' ;
1120import SettingsDialogContainer from './containers/SettingsDialogContainer' ;
1221import ShareDialogContainer from './containers/ShareDialogContainer' ;
1322import SplitPane from './components/SplitPane' ;
1423import ToolbarContainer from './containers/ToolbarContainer' ;
1524import TransformerContainer from './containers/TransformerContainer' ;
16- import createSagaMiddleware from 'redux-saga' ;
1725import debounce from './utils/debounce' ;
1826import saga from './store/sagas' ;
19- import {
20- Provider ,
21- connect ,
22- } from 'react-redux' ;
2327import {
2428 astexplorer ,
2529 persist ,
2630 revive ,
2731} from './store/reducers' ;
28- import {
29- createStore ,
30- applyMiddleware ,
31- compose ,
32- } from 'redux' ;
3332import {
3433 canSaveTransform ,
3534 getRevision ,
3635} from './store/selectors' ;
37- import { enableBatching } from 'redux-batched-actions' ;
3836import { loadSnippet } from './store/actions' ;
39- import { createRoot } from 'react-dom/client' ;
4037import * as gist from './storage/gist' ;
4138import * as parse from './storage/parse' ;
4239import StorageHandler from './storage' ;
@@ -106,9 +103,8 @@ store.subscribe(debounce(() => {
106103 const state = store . getState ( ) ;
107104
108105 // We are not persisting the state while looking at an existing revision
109- if ( ! getRevision ( state ) ) {
106+ if ( ! getRevision ( state ) )
110107 LocalStorage . writeState ( persist ( state ) ) ;
111- }
112108} ) ) ;
113109sagaMiddleware . run ( saga , new StorageHandler ( [ gist , parse ] ) ) ;
114110store . dispatch ( {
@@ -126,14 +122,12 @@ global.onhashchange = () => {
126122 store . dispatch ( loadSnippet ( ) ) ;
127123} ;
128124
129- if ( location . hash . length > 1 ) {
125+ if ( location . hash . length > 1 )
130126 store . dispatch ( loadSnippet ( ) ) ;
131- }
132127
133128global . onbeforeunload = ( ) => {
134129 const state = store . getState ( ) ;
135130
136- if ( canSaveTransform ( state ) ) {
131+ if ( canSaveTransform ( state ) )
137132 return 'You have unsaved transform code. Do you really want to leave?' ;
138- }
139133} ;
0 commit comments