chriscampbell96 / BlazorServerStateManagement

This highlights 3 different ways in which state can be managed on a Blazor Server Project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blazor Server State Management

Introduction

This highlights 3 different ways in which state can be managed on a Blazor Server Project.

Code Samples

Example one in the code shows how it can be done with a few lines of Javascript -

window.stateManager = {
	save: function (key, str) {
		localStorage[key] = str;
	},
	load: function (key) {
		return localStorage[key];
	},
	remove: function (key) {
		localStorage.removeItem(key);
    }
};

Examples 2 and 3 use the Nuget Package: Microsoft.AspNetCore.ProtectedBrowserStorage. You can read more on it here!

Installation

Simply clone the project, open the solution, build and run!

About

This highlights 3 different ways in which state can be managed on a Blazor Server Project.


Languages

Language:HTML 51.6%Language:C# 26.1%Language:CSS 21.0%Language:JavaScript 1.3%