UNPKG

@nent/core

Version:

Functional elements to add routing, data-binding, dynamic HTML, declarative actions, audio, video, and so much more. Supercharge static HTML files into web apps without script or builds.

29 lines (28 loc) 735 B
/*! * NENT 2022 */ import { commonState, debugIf } from '../../../services/common'; let provider; /** * `setAppProvider` is a function that takes a string and an object as parameters and sets the value of * the `provider` variable to the object. * @param {string} name - The name of the provider. * @param {any} p - the provider object */ export function setAppProvider(name, p) { debugIf(commonState.debug, `app-provider: ${name} registered`); provider = p; } /** * It returns the provider if it exists, otherwise it returns null * @returns The provider variable. */ export function getAppProvider() { return provider; } /** * It clears the app provider. */ export function clearAppProvider() { provider = null; }