1
1
import { DashLayoutPath , DashComponent , BaseDashProps } from '../types/component' ;
2
- import { getComponentLayout , stringifyPath , checkChildrenLayoutHashes } from './wrapping' ;
3
- import { pathOr } from 'ramda'
2
+ import {
3
+ getComponentLayout ,
4
+ stringifyPath ,
5
+ checkChildrenLayoutHashes
6
+ } from './wrapping' ;
7
+ import { pathOr } from 'ramda' ;
4
8
5
9
type SelectDashProps = [ DashComponent , BaseDashProps , number , object , string ] ;
6
10
@@ -10,17 +14,20 @@ interface ChangedPropsRecord {
10
14
renderType : string ;
11
15
}
12
16
13
- const previousHashes = { }
17
+ const previousHashes = { } ;
14
18
15
- function determineChangedProps ( state : any , strPath : string ) : ChangedPropsRecord {
19
+ function determineChangedProps (
20
+ state : any ,
21
+ strPath : string
22
+ ) : ChangedPropsRecord {
16
23
let combinedHash = 0 ;
17
- let renderType = 'update' ; // Default render type, adjust as needed
24
+ const renderType = 'update' ; // Default render type, adjust as needed
18
25
Object . entries ( state . layoutHashes ) . forEach ( ( [ updatedPath , pathHash ] ) => {
19
26
if ( updatedPath . startsWith ( strPath ) ) {
20
27
const previousHash : any = pathOr ( { } , [ updatedPath ] , previousHashes ) ;
21
- combinedHash += pathOr ( 0 , [ 'hash' ] , pathHash )
28
+ combinedHash += pathOr ( 0 , [ 'hash' ] , pathHash ) ;
22
29
if ( previousHash !== pathHash ) {
23
- previousHash [ updatedPath ] = pathHash
30
+ previousHash [ updatedPath ] = pathHash ;
24
31
}
25
32
}
26
33
} ) ;
@@ -43,7 +50,7 @@ export const selectDashProps =
43
50
44
51
let hash ;
45
52
if ( checkChildrenLayoutHashes ( c ) ) {
46
- hash = determineChangedProps ( state , strPath )
53
+ hash = determineChangedProps ( state , strPath ) ;
47
54
} else {
48
55
hash = state . layoutHashes [ strPath ] ;
49
56
}
0 commit comments