Home Reference Source
import Preloader from '@osjs/client/src/utils/preloader.js'
public class | source

Preloader

The Preloader loads styles and scripts

Member Summary

Public Members
public

$root: Element

public

A list of cached preloads

Method Summary

Public Methods
public

Loads all resources required for a package

Private Methods
private

_load(results: Object[], cached: string[]): PreloaderResult

Checks the loaded list

Public Members

public $root: Element source

public loaded: String[] source

A list of cached preloads

Public Methods

public load(list: string[], force: boolean): Promise<PreloaderResult> source

Loads all resources required for a package

Params:

NameTypeAttributeDescription
list string[]

A list of resources

force boolean
  • optional
  • default: false

Force loading even though previously cached

Return:

Promise<PreloaderResult>

A list of failed resources

Private Methods

private _load(results: Object[], cached: string[]): PreloaderResult source

Checks the loaded list

Params:

NameTypeAttributeDescription
results Object[]

Preload results

cached string[]

Already cached preloads

Return:

PreloaderResult