torhovland / blazor-redux

Connecting a Redux state store with Blazor.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is Location now a required Model parameter?

panesofglass opened this issue · comments

When building with the latest Blazor-Redux 0.0.4, I get the following:

Program.cs(17,25): error CS7036: There is no argument given that corresponds to the required formal parameter 'getLocation' of 'Store<MyModel, MyMsg>.Store(Reducer<MyModel, MyMsg>, Reducer<MyModel, LocationAction>, Func<MyModel, string>, MyModel)' [/Users/ryan/Code/trail/sample/blazor-redux-standalone/BlazorReduxApp/BlazorReduxApp.csproj]

Is a Location property now required, or am I reading this error incorrectly?

Based on the types, it appears this is now required. I think the only thing needed is to update the README so that users know it's a required part of the model. Does it need to be required? Or did I miss an alternative to wiring up the reducer?

Well, yes, the new routing is a pretty hardcoded requirement right now. I would like to make it optional, using a Redux middleware or something. But for now you'll need to provide a function that can retrieve the Location from your state.