This repository was archived by the owner on Jan 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Expand file tree Collapse file tree 2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -6,27 +6,23 @@ const styleSheetQueue: [string][] = [];
6
6
let isProcessing = false ;
7
7
8
8
function createGlobalStyleSheetPromise ( ) {
9
- globalStyleSheetPromise = new Promise < string > ( ( resolve ) => {
9
+ globalStyleSheetPromise = new Promise < string > ( resolve => {
10
10
resolveGlobalStyleSheet = ( value : string ) => {
11
11
styleSheetQueue . push ( [ value ] ) ;
12
12
resolve ( value ) ;
13
13
} ;
14
14
} ) ;
15
15
}
16
16
17
- async function executeBuildIn ( styleSheet : string ) : Promise < void > {
18
- if ( ! isDevelopment && styleSheet ) buildIn ( styleSheet ) ;
19
- }
20
-
21
- async function processStyleSheets ( ) {
17
+ function processStyleSheets ( ) {
22
18
while ( styleSheetQueue . length > 0 ) {
23
19
const [ styleSheet ] = styleSheetQueue . shift ( ) as [ string ] ;
24
- await executeBuildIn ( styleSheet ) ;
20
+ if ( ! isDevelopment && styleSheet ) buildIn ( styleSheet ) ;
25
21
}
26
22
isProcessing = false ;
27
23
}
28
24
29
- export function createBuildIn ( ) : void {
25
+ export async function createBuildIn ( ) : Promise < void > {
30
26
if ( typeof globalStyleSheetPromise === 'undefined' ) createGlobalStyleSheetPromise ( ) ;
31
27
if ( ! isProcessing && styleSheetQueue . length > 0 ) {
32
28
isProcessing = true ;
Original file line number Diff line number Diff line change @@ -6,27 +6,23 @@ const styleSheetQueue: [string][] = [];
6
6
let isProcessing = false ;
7
7
8
8
function createGlobalStyleSheetPromise ( ) {
9
- globalStyleSheetPromise = new Promise < string > ( ( resolve ) => {
9
+ globalStyleSheetPromise = new Promise < string > ( resolve => {
10
10
resolveGlobalStyleSheet = ( value : string ) => {
11
11
styleSheetQueue . push ( [ value ] ) ;
12
12
resolve ( value ) ;
13
13
} ;
14
14
} ) ;
15
15
}
16
16
17
- async function executeBuildIn ( styleSheet : string ) : Promise < void > {
18
- if ( ! isDevelopment && styleSheet ) buildIn ( styleSheet ) ;
19
- }
20
-
21
- async function processStyleSheets ( ) {
17
+ function processStyleSheets ( ) {
22
18
while ( styleSheetQueue . length > 0 ) {
23
19
const [ styleSheet ] = styleSheetQueue . shift ( ) as [ string ] ;
24
- await executeBuildIn ( styleSheet ) ;
20
+ if ( ! isDevelopment && styleSheet ) buildIn ( styleSheet ) ;
25
21
}
26
22
isProcessing = false ;
27
23
}
28
24
29
- export function setBuildIn ( ) : void {
25
+ export async function setBuildIn ( ) : Promise < void > {
30
26
if ( typeof globalStyleSheetPromise === 'undefined' ) createGlobalStyleSheetPromise ( ) ;
31
27
if ( ! isProcessing && styleSheetQueue . length > 0 ) {
32
28
isProcessing = true ;
You can’t perform that action at this time.
0 commit comments