Use a ConcurrentDictionary

This is used from a bunch of static methods. Dictionary isn't thread
safe. Encountered this while debugging some other things.
This commit is contained in:
Ryan Nowak 2019-08-10 18:13:16 -07:00
parent 9b4ec6ec71
commit 89bf58445f
1 changed files with 3 additions and 3 deletions

View File

@ -1,17 +1,17 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.JSInterop;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.JSInterop;
namespace BasicTestApp.InteropTest
{
public class JavaScriptInterop
{
public static IDictionary<string, object[]> Invocations = new Dictionary<string, object[]>();
public static ConcurrentDictionary<string, object[]> Invocations = new ConcurrentDictionary<string, object[]>();
[JSInvokable]
public static void ThrowException() => throw new InvalidOperationException("Threw an exception!");