Skip to content

Commit 1e35122

Browse files
committed
Adds readme.
1 parent da74982 commit 1e35122

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

sources/BlazorReduxDevToolsExtension/BlazorReduxDevToolsExtension.sln

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorReduxDevToolsExtensio
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorReduxDevToolsExtensionApp", "..\BlazorReduxDevToolsExtensionApp\BlazorReduxDevToolsExtensionApp.csproj", "{E0244B6F-C70C-4C24-AF80-0E0058D24EA2}"
99
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6AE590FF-6D7E-452E-B6FF-885618A5FF94}"
11+
ProjectSection(SolutionItems) = preProject
12+
README.md = README.md
13+
EndProjectSection
14+
EndProject
1015
Global
1116
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1217
Debug|Any CPU = Debug|Any CPU
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# BlazorReduxDevToolsExtension
2+
3+
[![NuGet](https://img.shields.io/nuget/v/Righthand.BlazorReduxDevToolsExtension.svg)](https://www.nuget.org/packages/Righthand.BlazorReduxDevToolsExtension)
4+
5+
This is a library that implements the interop between [Blazor](https://github.com/aspnet/Blazor) and [Redux DevTools extension](https://github.com/zalmoxisus/redux-devtools-extension). Which allows you communicating with it and use it's capabilities including time travel debugging.
6+
7+
Core methods are implemented. Options class is not yet implemented.
8+
9+
Built against Blazor 0.2.1.
10+
11+
## Sample usage
12+
13+
You find sample usage in BlazorReduxDevToolsExtensionApp application.
14+
15+
```csharp
16+
@using BlazorReduxDevToolsExtension
17+
@page "/"
18+
19+
<h1>ReduxDevTools Extension interop</h1>
20+
21+
<div>Present <b>@IsAvailable</b></div>
22+
<div>Last Message</div>
23+
<div>@LastMessage</div>
24+
25+
@functions {
26+
public bool IsAvailable => ReduxDevToolsExtension.IsAvailable();
27+
public string LastMessage { get; private set; } = "Nothing yet";
28+
29+
protected override void OnInit()
30+
{
31+
if (IsAvailable)
32+
{
33+
ReduxDevToolsExtension.Connect();
34+
ReduxDevToolsExtension.Init(new { Tubo = 88 });
35+
ReduxDevToolsExtension.MessageReceived += (s, e) =>
36+
{
37+
LastMessage = e.Message;
38+
StateHasChanged();
39+
};
40+
ReduxDevToolsExtension.Subscribe();
41+
ReduxDevToolsExtension.Send(new { type = "AnAction" }, new { Tubo = 109 });
42+
ReduxDevToolsExtension.Send(new { type = "Another" }, new { Tubo = 504 });
43+
// uncomment it but put a bit of delay in between, otherwise it unsubscribes too early
44+
//ReduxDevToolsExtension.UnSubscribe();
45+
//ReduxDevToolsExtension.Disconnect();
46+
}
47+
}
48+
}
49+
```

0 commit comments

Comments
 (0)