Skip to content

Commit

Permalink
Make JSRuntime.Current non-public
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavkm committed Feb 15, 2019
1 parent 2410295 commit 3b46605
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Expand Up @@ -52,7 +52,6 @@ public static partial class Json
}
public static partial class JSRuntime
{
public static Microsoft.JSInterop.IJSRuntime Current { get { throw null; } }
public static void SetCurrentJSRuntime(Microsoft.JSInterop.IJSRuntime instance) { }
}
public abstract partial class JSRuntimeBase : Microsoft.JSInterop.IJSRuntime
Expand Down
8 changes: 2 additions & 6 deletions src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs
Expand Up @@ -11,13 +11,9 @@ namespace Microsoft.JSInterop
/// </summary>
public static class JSRuntime
{
private static AsyncLocal<IJSRuntime> _currentJSRuntime
= new AsyncLocal<IJSRuntime>();
private static readonly AsyncLocal<IJSRuntime> _currentJSRuntime = new AsyncLocal<IJSRuntime>();

/// <summary>
/// Gets the current <see cref="IJSRuntime"/>, if any.
/// </summary>
public static IJSRuntime Current => _currentJSRuntime.Value;
internal static IJSRuntime Current => _currentJSRuntime.Value;

/// <summary>
/// Sets the current JS runtime to the supplied instance.
Expand Down

0 comments on commit 3b46605

Please sign in to comment.