Basaingeal / Razor.SweetAlert2

A Razor class library for interacting with SweetAlert2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use Generics in SweetAlertResults

Basaingeal opened this issue · comments

Right now the Value of a SweetAlertResult can only be a string.

Create Generic versions of Swal.FireAsync(), Swal.QueueAsync(), and SweetAlertResult so that users can specify the return type they expect.

Not implementing

The use case is too varied for how strict the C# type system is. Most of the time (with queues especially) each step will give you data in a different form, or if it's that same form, that form will be a string. But if you wanted to have a swal with a bool, then a string, then a bool, there's isn't much of an IEnumerable type you could use beside object, which isn't better than strings that are handled by use-case.

Open to comments and PRs are open though if anyone would think that this is a worthwhile feature.