Skip to content
Permalink
Browse files

feat(index): move isInitialized to aurelia-pal

  • Loading branch information...
niieani committed Nov 21, 2016
1 parent 766fc50 commit 7b75f001ba453f134e4bc649e85f697608c08697
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/index.js
@@ -306,12 +306,16 @@ interface Dom {
* The singleton instance of the Dom API.
*/
export const DOM: Dom = {};

export let isInitialized = false;
/**
* Enables initializing a specific implementation of the Platform Abstraction Layer (PAL).
* @param callback Allows providing a callback which configures the three PAL singletons with their platform-specific implementations.
*/
export function initializePAL(callback: (platform: Platform, feature: Feature, dom: Dom) => void): void {
if (isInitialized) {
return;
}
isInitialized = true;
if (typeof Object.getPropertyDescriptor !== 'function') {
Object.getPropertyDescriptor = function(subject, name) {
let pd = Object.getOwnPropertyDescriptor(subject, name);
@@ -326,3 +330,6 @@ export function initializePAL(callback: (platform: Platform, feature: Feature, d

callback(PLATFORM, FEATURE, DOM);
}
export function reset() {
isInitialized = false;
}

0 comments on commit 7b75f00

Please sign in to comment.
You can’t perform that action at this time.