Is there any analogous pattern in javascript for using events as is used in .net (see https://docs.microsoft.com/en-us/dotnet/csharp/event-pattern)?
Or maybe the way