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][] = [];
66let isProcessing = false ;
77
88function createGlobalStyleSheetPromise ( ) {
9- globalStyleSheetPromise = new Promise < string > ( ( resolve ) => {
9+ globalStyleSheetPromise = new Promise < string > ( resolve => {
1010 resolveGlobalStyleSheet = ( value : string ) => {
1111 styleSheetQueue . push ( [ value ] ) ;
1212 resolve ( value ) ;
1313 } ;
1414 } ) ;
1515}
1616
17- async function executeBuildIn ( styleSheet : string ) : Promise < void > {
18- if ( ! isDevelopment && styleSheet ) buildIn ( styleSheet ) ;
19- }
20-
21- async function processStyleSheets ( ) {
17+ function processStyleSheets ( ) {
2218 while ( styleSheetQueue . length > 0 ) {
2319 const [ styleSheet ] = styleSheetQueue . shift ( ) as [ string ] ;
24- await executeBuildIn ( styleSheet ) ;
20+ if ( ! isDevelopment && styleSheet ) buildIn ( styleSheet ) ;
2521 }
2622 isProcessing = false ;
2723}
2824
29- export function createBuildIn ( ) : void {
25+ export async function createBuildIn ( ) : Promise < void > {
3026 if ( typeof globalStyleSheetPromise === 'undefined' ) createGlobalStyleSheetPromise ( ) ;
3127 if ( ! isProcessing && styleSheetQueue . length > 0 ) {
3228 isProcessing = true ;
Original file line number Diff line number Diff line change @@ -6,27 +6,23 @@ const styleSheetQueue: [string][] = [];
66let isProcessing = false ;
77
88function createGlobalStyleSheetPromise ( ) {
9- globalStyleSheetPromise = new Promise < string > ( ( resolve ) => {
9+ globalStyleSheetPromise = new Promise < string > ( resolve => {
1010 resolveGlobalStyleSheet = ( value : string ) => {
1111 styleSheetQueue . push ( [ value ] ) ;
1212 resolve ( value ) ;
1313 } ;
1414 } ) ;
1515}
1616
17- async function executeBuildIn ( styleSheet : string ) : Promise < void > {
18- if ( ! isDevelopment && styleSheet ) buildIn ( styleSheet ) ;
19- }
20-
21- async function processStyleSheets ( ) {
17+ function processStyleSheets ( ) {
2218 while ( styleSheetQueue . length > 0 ) {
2319 const [ styleSheet ] = styleSheetQueue . shift ( ) as [ string ] ;
24- await executeBuildIn ( styleSheet ) ;
20+ if ( ! isDevelopment && styleSheet ) buildIn ( styleSheet ) ;
2521 }
2622 isProcessing = false ;
2723}
2824
29- export function setBuildIn ( ) : void {
25+ export async function setBuildIn ( ) : Promise < void > {
3026 if ( typeof globalStyleSheetPromise === 'undefined' ) createGlobalStyleSheetPromise ( ) ;
3127 if ( ! isProcessing && styleSheetQueue . length > 0 ) {
3228 isProcessing = true ;
You can’t perform that action at this time.
0 commit comments