Skip to content

Commit b07e108

Browse files
Merge pull request #9 from galvesribeiro/master
Fix JS name collision.
2 parents f7b8df4 + a379f25 commit b07e108

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Blazor.Extensions.Logging.JS/src/Initialize.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ function initialize() {
2222
// When the library is loaded in a browser via a <script> element, make the
2323
// following APIs available in global scope for invocation from JS
2424
window['BlazorExtensions'] = {
25-
Logging: {
26-
BrowserConsoleLogger: {
27-
}
25+
};
26+
}
27+
28+
if (typeof window['BlazorExtensions']['Logging'] === 'undefined') {
29+
// When the library is loaded in a browser via a <script> element, make the
30+
// following APIs available in global scope for invocation from JS
31+
window['BlazorExtensions']['Logging'] = {
32+
BrowserConsoleLogger: {
2833
}
2934
};
3035
}

0 commit comments

Comments
 (0)