-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Adding a "boostrapExtra()" function to bootstrap the extra script.
- Loading branch information
Showing
3 changed files
with
20 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
// This file automatically bootstraps all the features on WA initialization. | ||
// Importing this file creates a number of side effects. | ||
|
||
import { initDoors } from "./Features/doors"; | ||
import { initConfiguration } from "./Features/configuration"; | ||
import { initPropertiesTemplates } from "./Features/properties_templates"; | ||
import {initSpecialProperties} from "./Features/special_properties"; | ||
import {bootstrapExtra} from "./init"; | ||
|
||
WA.onInit().then(() => { | ||
initDoors().catch((e) => console.error(e)); | ||
initSpecialProperties().catch((e) => console.error(e)); | ||
initConfiguration().catch((e) => console.error(e)); | ||
initPropertiesTemplates().catch((e) => console.error(e)); | ||
}); | ||
bootstrapExtra(); | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {initDoors} from "./Features/doors"; | ||
import {initSpecialProperties} from "./Features/special_properties"; | ||
import {initConfiguration} from "./Features/configuration"; | ||
import {initPropertiesTemplates} from "./Features/properties_templates"; | ||
|
||
/** | ||
* Bootstraps all the features of the extra library. | ||
* This function must be called once if you are importing this library in your own WorkAdventure script. | ||
*/ | ||
export function bootstrapExtra(): Promise<void> { | ||
return WA.onInit().then(() => { | ||
initDoors().catch((e) => console.error(e)); | ||
initSpecialProperties().catch((e) => console.error(e)); | ||
initConfiguration().catch((e) => console.error(e)); | ||
initPropertiesTemplates().catch((e) => console.error(e)); | ||
}); | ||
} |