File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 23
23
},
24
24
"javascript" : {
25
25
"formatter" : {
26
- "trailingComma " : " none" ,
26
+ "trailingCommas " : " none" ,
27
27
"arrowParentheses" : " asNeeded" ,
28
28
"quoteStyle" : " single"
29
29
}
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ import {
20
20
isInterleaved
21
21
} from './utils' ;
22
22
23
+ /** @typedef {{ urlOrFile: string | File; description: string; isDemoImage: boolean; } } ImageSource */
24
+
25
+ /** @param {ImageSource } source */
23
26
export const useImage = source => {
24
27
const [ use3d , toggleUse3d , toggleIsOffsetsSnackbarOn ] = useViewerStore (
25
28
store => [ store . use3d , store . toggleUse3d , store . toggleIsOffsetsSnackbarOn ] ,
@@ -81,6 +84,15 @@ export const useImage = source => {
81
84
}
82
85
}
83
86
if ( source ) changeLoader ( ) ;
87
+
88
+ // FIXME: biome warns that source shouldn't be a dep because it changes every render,
89
+ // but it's necessary to trigger the effect (and make avivator functional).
90
+ //
91
+ // The overall implementation of this "hook" is very strange. It is all async side effects
92
+ // that eventually update global state and is very tricky to reason about. There is probably
93
+ // a more ideomatic way to do this with zustand.
94
+ //
95
+ // biome-ignore lint/correctness/useExhaustiveDependencies: see above
84
96
} , [ source , history ] ) ;
85
97
86
98
// biome-ignore lint/correctness/useExhaustiveDependencies: Carried over from eslint, without explanation.
You can’t perform that action at this time.
0 commit comments