Manual Reference Source Test
import PluginLoader from 'beloader/src/loaders/PluginLoader.js'
public class | version 1.0.0 | since 1.0.0 | source

PluginLoader

Extends:

AbstractEventManagerAbstractLoader → PluginLoader

Loads a beloader plugin

Constructor Summary

Public Constructor
public

constructor(parent: QueueItem, options: DotObjectArray)

version 1.0.0 since 1.0.0

Member Summary

Public Members
public get

Getter that generates HTMLElement to contain script (sync or async)

version 1.0.0 since 1.0.0
Private Members
private

Underlying node for insertion

Method Summary

Public Methods
public

Load plugin script, insert response in a <script> tag and import in plugins when finished

version 1.0.0 since 1.0.0
public

Insert plugin code in <script> tag with src for sync loading and import in plugins when finished

version 1.0.0 since 1.0.0
Private Methods
private

_loadPlugin(p: $type): type

Description for _load

version 1.0.0 since 1.0.0

Inherited Summary

From class AbstractEventManager
private

Callback's list by eventName

since 1.0.0
public

fire(eventName: string, target: Beloader | QueueItem | Loader | Plugin, data: object | array | number | string)

Fire an event

version 1.0.0 since 1.0.0
public

on(eventName: string, callback: Function)

Register events callbacks after instance creation

version 1.0.0 since 1.0.0
private

Dispatch an event

version 1.0.0 since 1.0.0
From class AbstractLoader
public get

Loader promise

version 1.0.0 since 1.0.0
public

Loader options

since 1.0.0
public

Requesting parent item

since 1.0.0
private

Map plugins

since 1.0.0
public abstract

The async method relies on fetching content with an XHR request and inserting it inline in the document, wrapped in right HTML container if needed

version 1.0.0 since 1.0.0
public abstract

The sync method mostly relies on adding an HTMLElement to the DOM to load asset.

version 1.0.0 since 1.0.0

Public Constructors

public constructor(parent: QueueItem, options: DotObjectArray) version 1.0.0 since 1.0.0 source

Constructor

Override:

AbstractLoader#constructor

Params:

NameTypeAttributeDescription
parent QueueItem

Calling QueueItem

options DotObjectArray

Options for the loader

options.name string

Plugin var name

options.url string
  • optional

Plugin script url

options.inline boolean
  • optional
  • default: false

If true, the plugin script will be evaluated inline

Public Members

public get node: HTMLElement version 1.0.0 since 1.0.0 source

Getter that generates HTMLElement to contain script (sync or async)

Private Members

private _node: HTMLElement source

Underlying node for insertion

Public Methods

public async(): Promise version 1.0.0 since 1.0.0 source

Load plugin script, insert response in a <script> tag and import in plugins when finished

Override:

AbstractLoader#async

Return:

Promise

Loading promise

public sync(): Promise version 1.0.0 since 1.0.0 source

Insert plugin code in <script> tag with src for sync loading and import in plugins when finished

Override:

AbstractLoader#sync

Return:

Promise

Loading promise

Private Methods

private _loadPlugin(p: $type): type version 1.0.0 since 1.0.0 source

Description for _load

Params:

NameTypeAttributeDescription
p $type

Description for p

Return:

type

Return description