File tree Expand file tree Collapse file tree 3 files changed +24
-21
lines changed Expand file tree Collapse file tree 3 files changed +24
-21
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
144
144
checked = { stateful }
145
145
onChange = { e => {
146
146
toggleComponentState ( id ) ;
147
- changeFocusComponent ( { title } ) ;
147
+ // changeFocusComponent({ title });
148
148
} }
149
149
value = 'stateful'
150
150
color = 'primary'
@@ -168,7 +168,7 @@ const LeftColExpansionPanel = (props: LeftColExpPanPropsInt) => {
168
168
checked = { classBased }
169
169
onChange = { e => {
170
170
toggleComponentClass ( id ) ;
171
- changeFocusComponent ( { title } ) ;
171
+ // changeFocusComponent({ title });
172
172
} }
173
173
value = 'classBased'
174
174
color = 'primary'
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
10
10
ComponentsInt ,
11
11
PropInt
12
12
} from './Interfaces' ;
13
+ import { createHistory } from './helperFunctions'
13
14
14
15
//this is the default values for any component added to the app.
15
16
@@ -32,25 +33,6 @@ const initialComponentState: ComponentInt = {
32
33
focusChildId : 0
33
34
} ;
34
35
35
- /*Helper function that copies the state to be added on to the history
36
- By clearing the history data out of each stored step of the timeline,
37
- you can avoid repetitive nesting that maxes out the memory allocated to electron
38
- (usually happens at around 7-10 steps without using this method)*/
39
- const createHistory = ( state : ApplicationStateInt ) => {
40
- const stateCopy = cloneDeep ( state ) ;
41
- const historyCopy = cloneDeep ( state . history ) ;
42
- historyCopy . push ( { ...stateCopy , history : [ ] } ) ;
43
- const history = historyCopy ;
44
- const historyIndex = state . historyIndex + 1 ;
45
- const future : [ ] = [ ] ;
46
-
47
- return {
48
- history,
49
- historyIndex,
50
- future
51
- } ;
52
- } ;
53
-
54
36
export const addComponent = (
55
37
state : ApplicationStateInt ,
56
38
{ title } : { title : string }
Original file line number Diff line number Diff line change
1
+ import { ApplicationStateInt } from './Interfaces' ;
2
+ import cloneDeep from './cloneDeep' ;
3
+
4
+ /*Helper function that copies the state to be added on to the history
5
+ By clearing the history data out of each stored step of the timeline,
6
+ you can avoid repetitive nesting that maxes out the memory allocated to electron
7
+ (usually happens at around 7-10 steps without using this method)*/
8
+ export const createHistory = ( state : ApplicationStateInt ) => {
9
+ const stateCopy = cloneDeep ( state ) ;
10
+ const historyCopy = cloneDeep ( state . history ) ;
11
+ historyCopy . push ( { ...stateCopy , history : [ ] } ) ;
12
+ const history = historyCopy ;
13
+ const historyIndex = state . historyIndex + 1 ;
14
+ const future : [ ] = [ ] ;
15
+
16
+ return {
17
+ history,
18
+ historyIndex,
19
+ future,
20
+ } ;
21
+ } ;
You can’t perform that action at this time.
0 commit comments