Skip to content

Commit

Permalink
Merge pull request #494 from TimeWarpEngineering/Cramer/2024-10-20/Sa…
Browse files Browse the repository at this point in the history
…mples

Cramer/2024 10 20/samples
  • Loading branch information
StevenTCramer authored Oct 22, 2024
2 parents 8170a0b + 20baf7d commit 700e9cd
Show file tree
Hide file tree
Showing 12 changed files with 187 additions and 54 deletions.
39 changes: 6 additions & 33 deletions Documentation/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,11 @@
uid: TimeWarpState:Overview.md
title: TimeWarp.State Overview
---
[!include[Badges](Partials/Badges.md)]

[![Dotnet](https://img.shields.io/badge/dotnet-6.0-blue)](https://dotnet.microsoft.com)
[![Stars](https://img.shields.io/github/stars/TimeWarpEngineering/timewarp-state?logo=github)](https://github.com/TimeWarpEngineering/timewarp-state)
[![Discord](https://img.shields.io/discord/715274085940199487?logo=discord)](https://discord.gg/7F4bS2T)
[![workflow](https://github.com/TimeWarpEngineering/timewarp-state/actions/workflows/release-build.yml/badge.svg)](https://github.com/TimeWarpEngineering/timewarp-state/actions)
[![nuget](https://img.shields.io/nuget/v/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
[![nuget](https://img.shields.io/nuget/dt/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
[![Issues Open](https://img.shields.io/github/issues/TimeWarpEngineering/timewarp-state.svg?logo=github)](https://github.com/TimeWarpEngineering/timewarp-state/issues)
[![Forks](https://img.shields.io/github/forks/TimeWarpEngineering/timewarp-state)](https://github.com/TimeWarpEngineering/timewarp-state)
[![License](https://img.shields.io/github/license/TimeWarpEngineering/timewarp-state.svg?style=flat-square&logo=github)](https://github.com/TimeWarpEngineering/timewarp-state/issues)
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2FTimeWarpEngineering%2Fblazor-state)](https://twitter.com/intent/tweet?url=https://github.com/TimeWarpEngineering/timewarp-state)

[![Twitter](https://img.shields.io/twitter/follow/StevenTCramer.svg)](https://twitter.com/intent/follow?screen_name=StevenTCramer)
[![Twitter](https://img.shields.io/twitter/follow/TheFreezeTeam1.svg)](https://twitter.com/intent/follow?screen_name=TheFreezeTeam1)

# TimeWarp.State

![TimeWarp Logo](https://raw.githubusercontent.com/TimeWarpEngineering/timewarp-state/master/Assets/Logo.svg)

Previously known as Blazor-State. [![nuget](https://img.shields.io/nuget/dt/Blazor-State?logo=nuget)](https://www.nuget.org/packages/Blazor-State/)

TimeWarp.State is a State Management architecture utilizing the MediatR pipeline.
Expand All @@ -32,21 +18,10 @@ All of the behaviors are written as middleware to the MediatR pipeline.

Please see the **[GitHub Site](https://github.com/TimeWarpEngineering/timewarp-state)** for source and filing of issues.

## Installation

You can get the latest NuGet packages from the official [TimeWarp NuGet page](https://www.nuget.org/profiles/TimeWarp.Enterprises).

* [TimeWarp.State](https://www.nuget.org/packages/TimeWarp.State/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
[!include[Installation](Partials/Installation.md)]

```console
dotnet add package TimeWarp.State
```

## Getting Started
[!include[Installation](Partials/GettingStarted.md)]

If you are just beginning with Blazor then I recommend you start at the [dotnet blazor site](https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor).

If you already know a bit about Blazor then I recommend the [tutorial](xref:TimeWarp.State:00-StateActionHandler.md)

### Tutorial

Expand Down Expand Up @@ -134,13 +109,11 @@ Thus, async calls to fetch data, send emails, or just update local state
are implemented in the same manner. Although the developer **should** be aware when Handlers have side effects and
if the developer chose they could mark the Requests as such. For example **IActionWithSideEffect**

[!include[Contributing](Partials/acknowledgements.md)]

## UnLicense
[!include[Acknowledgements](Partials/Acknowledgements.md)]

[The Unlicense](https://choosealicense.com/licenses/unlicense/)
[!include[License](Partials/License.md)]

[!include[Contributing](Partials/contributing.md)]
[!include[Contributing](Partials/Contributing.md)]

#### Footnotes:

Expand Down
22 changes: 22 additions & 0 deletions Documentation/Partials/Badges.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
uid: TimeWarpState:Badges.md
title: Badges
---
[![Stars](https://img.shields.io/github/stars/TimeWarpEngineering/timewarp-state?logo=github)](https://github.com/TimeWarpEngineering/timewarp-state)
[![workflow](https://github.com/TimeWarpEngineering/timewarp-state/actions/workflows/release-build.yml/badge.svg)](https://github.com/TimeWarpEngineering/timewarp-state/actions)
[![Forks](https://img.shields.io/github/forks/TimeWarpEngineering/timewarp-state)](https://github.com/TimeWarpEngineering/timewarp-state)
[![License](https://img.shields.io/github/license/TimeWarpEngineering/timewarp-state.svg?style=flat-square&logo=github)](https://github.com/TimeWarpEngineering/timewarp-state/issues)
[![Issues Open](https://img.shields.io/github/issues/TimeWarpEngineering/timewarp-state.svg?logo=github)](https://github.com/TimeWarpEngineering/timewarp-state/issues)

[![nuget](https://img.shields.io/nuget/v/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
[![nuget](https://img.shields.io/nuget/dt/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
[![nuget](https://img.shields.io/nuget/dt/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)

[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2FTimeWarpEngineering%2Ftimewarp-state)](https://twitter.com/intent/tweet?url=https://github.com/TimeWarpEngineering/timewarp-state)
[![Dotnet](https://img.shields.io/badge/dotnet-8.0-blue)](https://dotnet.microsoft.com)

[![Discord](https://img.shields.io/discord/715274085940199487?logo=discord)](https://discord.gg/7F4bS2T)
[![Twitter](https://img.shields.io/twitter/follow/StevenTCramer.svg)](https://twitter.com/intent/follow?screen_name=StevenTCramer)
[![Twitter](https://img.shields.io/twitter/follow/TheFreezeTeam1.svg)](https://twitter.com/intent/follow?screen_name=TheFreezeTeam1)

![TimeWarp Logo](https://raw.githubusercontent.com/TimeWarpEngineering/timewarpengineering.github.io/refs/heads/master/images/LogoNoMarginNoShadow.svg)
10 changes: 10 additions & 0 deletions Documentation/Partials/Contact.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
uid: TimeWarp.State.Contact.md
title: Contact
---

## Contact

If you have an issue and don't receive a timely response, feel free to reach out on our [Discord server](https://discord.gg/A55JARGKKP).

[![Discord](https://img.shields.io/discord/715274085940199487?logo=discord)](https://discord.gg/7F4bS2T)
5 changes: 2 additions & 3 deletions Documentation/Partials/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ title: Contributing

## Contributing

Time is of the essence. Before developing a Pull Request I recommend opening an [discussion](https://github.com/TimeWarpEngineering/timewarp-state/discussions).
Your contributions are welcome! Before starting any work, please open a [discussion](https://github.com/TimeWarpEngineering/timewarp-state/discussions).

Please feel free to make suggestions and help out with the [documentation](https://timewarpengineering.github.io/timewarp-state/).
Please refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
Help with the [documentation](https://timewarpengineering.github.io/timewarp-state/) is also greatly appreciated.
12 changes: 12 additions & 0 deletions Documentation/Partials/GettingStarted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
uid: TimeWarp.State.GettingStarted.md
title: Getting Started
---

## Getting Started

If you are just beginning with Blazor then I recommend you start at the [dotnet blazor site](https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor).

If you already know a bit about Blazor then I recommend the [tutorial](xref:TimeWarp.State:00-StateActionHandler.md)

![TimeWarpStateOneWayFlow.drawio.svg](https://raw.githubusercontent.com/TimeWarpEngineering/timewarp-state/refs/heads/master/Documentation/Images/TimeWarpStateOneWayFlow.drawio.svg)
8 changes: 8 additions & 0 deletions Documentation/Partials/GiveAStar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
uid: TimeWarp.State.GiveAStar.md
title: Give a Star
---

## Give a Star! :star:

If you find this project useful, please give it a star. Thanks!
16 changes: 16 additions & 0 deletions Documentation/Partials/Installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
uid: TimeWarp.State.Installation.md
title: Installation
---

## Installation

```console
dotnet add package TimeWarp.State
dotnet add package TimeWarp.State.Plus
```

Check out the latest NuGet packages on the [TimeWarp Enterprises NuGet page](https://www.nuget.org/profiles/TimeWarp.Enterprises).

* [TimeWarp.State](https://www.nuget.org/packages/TimeWarp.State/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
* [TimeWarp.State.Plus](https://www.nuget.org/packages/TimeWarp.State.Plus/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State.Plus?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State.Plus/)
9 changes: 9 additions & 0 deletions Documentation/Partials/License.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
uid: TimeWarp.State.License.md
title: License
---

## Unlicense

[![License](https://img.shields.io/github/license/TimeWarpEngineering/timewarp-state.svg?style=flat-square&logo=github)](https://unlicense.org)
This project is licensed under the [Unlicense](https://unlicense.org).
8 changes: 8 additions & 0 deletions Documentation/Partials/Releases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
uid: TimeWarp.State.Releases.md
title: Releases
---

## Releases

View the [Release Notes](https://timewarpengineering.github.io/timewarp-state/ReleaseNotes/Release11.0.0.html) for detailed information on each release.
12 changes: 12 additions & 0 deletions Documentation/Partials/Summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
uid: TimeWarp.State.Summary.md
title: Summary
---

# TimeWarp.State

**TimeWarp.State** (previously known as Blazor-State) is a fully asynchronous state management library for Blazor applications, leveraging the MediatR pipeline to implement the Flux pattern. It handles both Reducers and Effects consistently using async Handlers, simplifying the management of asynchronous operations throughout your app.

By utilizing the MediatR pipeline, TimeWarp.State enables a flexible, middleware-driven architecture for managing state, similar to the request-processing pipeline in ASP.NET. This approach allows developers to inject custom behaviors, such as logging, validation, and caching, directly into the state management flow.

In addition to the core library, we offer **[TimeWarp.State.Plus](/Source/TimeWarp.State.Plus)**, which extends the functionality with enhanced middleware, components, and tools to further streamline state management in complex Blazor applications.
43 changes: 25 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,72 @@
[![Dotnet](https://img.shields.io/badge/dotnet-8.0-blue)](https://dotnet.microsoft.com)
[![Stars](https://img.shields.io/github/stars/TimeWarpEngineering/timewarp-state?logo=github)](https://github.com/TimeWarpEngineering/timewarp-state)
[![Discord](https://img.shields.io/discord/715274085940199487?logo=discord)](https://discord.gg/7F4bS2T)
[![workflow](https://github.com/TimeWarpEngineering/timewarp-state/actions/workflows/release-build.yml/badge.svg)](https://github.com/TimeWarpEngineering/timewarp-state/actions)
[![Forks](https://img.shields.io/github/forks/TimeWarpEngineering/timewarp-state)](https://github.com/TimeWarpEngineering/timewarp-state)
[![License](https://img.shields.io/github/license/TimeWarpEngineering/timewarp-state.svg?style=flat-square&logo=github)](https://github.com/TimeWarpEngineering/timewarp-state/issues)
[![Issues Open](https://img.shields.io/github/issues/TimeWarpEngineering/timewarp-state.svg?logo=github)](https://github.com/TimeWarpEngineering/timewarp-state/issues)

[![nuget](https://img.shields.io/nuget/v/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
[![nuget](https://img.shields.io/nuget/dt/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
[![nuget](https://img.shields.io/nuget/dt/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
[![Issues Open](https://img.shields.io/github/issues/TimeWarpEngineering/timewarp-state.svg?logo=github)](https://github.com/TimeWarpEngineering/timewarp-state/issues)
[![Forks](https://img.shields.io/github/forks/TimeWarpEngineering/timewarp-state)](https://github.com/TimeWarpEngineering/timewarp-state)
[![License](https://img.shields.io/github/license/TimeWarpEngineering/timewarp-state.svg?style=flat-square&logo=github)](https://github.com/TimeWarpEngineering/timewarp-state/issues)

[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2FTimeWarpEngineering%2Ftimewarp-state)](https://twitter.com/intent/tweet?url=https://github.com/TimeWarpEngineering/timewarp-state)
[![Dotnet](https://img.shields.io/badge/dotnet-8.0-blue)](https://dotnet.microsoft.com)

[![Discord](https://img.shields.io/discord/715274085940199487?logo=discord)](https://discord.gg/7F4bS2T)
[![Twitter](https://img.shields.io/twitter/follow/StevenTCramer.svg)](https://twitter.com/intent/follow?screen_name=StevenTCramer)
[![Twitter](https://img.shields.io/twitter/follow/TheFreezeTeam1.svg)](https://twitter.com/intent/follow?screen_name=TheFreezeTeam1)

# TimeWarp.State

![TimeWarp Logo](https://raw.githubusercontent.com/TimeWarpEngineering/timewarpengineering.github.io/refs/heads/master/images/LogoNoMarginNoShadow.svg)

# TimeWarp.State

TimeWarp.State is a State Management architecture utilizing the MediatR pipeline to implement the flux pattern.
**TimeWarp.State** (previously known as Blazor-State) is a fully asynchronous state management library for Blazor applications, leveraging the MediatR pipeline to implement the Flux pattern. It handles both Reducers and Effects consistently using async Handlers, simplifying the management of asynchronous operations throughout your app.

We also offer [TimeWarp.State.Plus](/Source/TimeWarp.State.Plus), which extends the core functionality with additional features, middleware, and components to simplify and enhance your Blazor applications.
By utilizing the MediatR pipeline, TimeWarp.State enables a flexible, middleware-driven architecture for managing state, similar to the request-processing pipeline in ASP.NET. This approach allows developers to inject custom behaviors, such as logging, validation, and caching, directly into the state management flow.

In addition to the core library, we offer **[TimeWarp.State.Plus](/Source/TimeWarp.State.Plus)**, which extends the functionality with enhanced middleware, components, and tools to further streamline state management in complex Blazor applications.

## Give a Star! :star:

If you find this project useful, please give it a star. Thanks!

## Getting Started

## Getting started
If you are just beginning with Blazor then I recommend you start at the [dotnet blazor site](https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor).

To quickly get started I recommend the [tutorial](https://timewarpengineering.github.io/timewarp-state/Samples/00-StateActionHandler/Readme.html) section of the full [Documentation](https://timewarpengineering.github.io/timewarp-state/).

![TimeWarpStateOneWayFlow.drawio.svg](/Documentation/Images/TimeWarpStateOneWayFlow.drawio.svg)
If you already know a bit about Blazor then I recommend the [tutorial](xref:TimeWarp.State:00-StateActionHandler.md)

![TimeWarpStateOneWayFlow.drawio.svg](https://raw.githubusercontent.com/TimeWarpEngineering/timewarp-state/refs/heads/master/Documentation/Images/TimeWarpStateOneWayFlow.drawio.svg)

## Installation

```console
dotnet add package TimeWarp.State
dotnet add package TimeWarp.State.Plus
```

Check out the latest NuGet packages on the [TimeWarp NuGet page](https://www.nuget.org/profiles/TimeWarp.Enterprises).
Check out the latest NuGet packages on the [TimeWarp Enterprises NuGet page](https://www.nuget.org/profiles/TimeWarp.Enterprises).

* [TimeWarp.State](https://www.nuget.org/packages/TimeWarp.State/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
* [TimeWarp.State.Plus](https://www.nuget.org/packages/TimeWarp.State.Plus/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State.Plus?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State.Plus/)


## Releases

View the [Release Notes](https://timewarpengineering.github.io/timewarp-state/ReleaseNotes/Release11.0.0.html) for detailed information on each release.


## Unlicense

[![License](https://img.shields.io/github/license/TimeWarpEngineering/timewarp-state.svg?style=flat-square&logo=github)](https://unlicense.org)
This project is licensed under the [Unlicense](https://unlicense.org).


## Contributing

Your contributions are welcome! Before starting any work, please open a [discussion](https://github.com/TimeWarpEngineering/timewarp-state/discussions).

Help with the [documentation](https://timewarpengineering.github.io/timewarp-state/) is also greatly appreciated.


## Contact

If you have an issue and don't receive a timely response, feel free to reach out on our [Discord server](https://discord.gg/A55JARGKKP).

[![Discord](https://img.shields.io/discord/715274085940199487?logo=discord)](https://discord.gg/7F4bS2T)

57 changes: 57 additions & 0 deletions Scripts/BuildReadMe.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# BuildReadMe.ps1 - Concatenate multiple Markdown files into a single README.md, removing YAML front matter.

# Function to remove YAML front matter from content
function Remove-YamlFrontMatter {
param([string]$content)
if ($content -match "^---\s*\r?\n([\s\S]*?)\r?\n---\s*\r?\n") {
return $content -replace "^---\s*\r?\n[\s\S]*?\r?\n---\s*\r?\n", ""
}
return $content
}

# Save the current directory and ensure we return to it after execution.
try {
Push-Location

# Define the list of files to include in the README.md in the desired order.
$files = @(
"../Documentation/Partials/Badges.md",
"../Documentation/Partials/Summary.md",
"../Documentation/Partials/GiveAStar.md",
"../Documentation/Partials/GettingStarted.md",
"../Documentation/Partials/Installation.md",
"../Documentation/Partials/Releases.md",
"../Documentation/Partials/License.md",
"../Documentation/Partials/Contributing.md",
"../Documentation/Partials/Contact.md"
)

# Define the output file.
$outputFile = "../README.md"

# Remove the existing README.md if it exists to start fresh.
if (Test-Path $outputFile) {
Remove-Item $outputFile
}

# Concatenate each file's content into the README.md, removing YAML front matter.
foreach ($file in $files) {
if (Test-Path $file) {
$content = Get-Content $file -Raw
$contentWithoutFrontMatter = Remove-YamlFrontMatter $content
$contentWithoutFrontMatter | Add-Content $outputFile
}
else {
Write-Host "Warning: $file does not exist and will be skipped."
}
}

Write-Host "README.md has been successfully generated with YAML front matter removed."
}
catch {
Write-Host "An error occurred: $_"
}
finally {
# Return to the original directory.
Pop-Location
}

0 comments on commit 700e9cd

Please sign in to comment.