Provide process id
to before middleware
#308
Labels
area: core
Core
enhancement
New feature or request
next
Issue/Pull Request for the next major version
Enhancement
I created a middleware that automatically updates the store to indicate that the process is in progress using an object literal mapping in the store. Its easy to update the related state in the
after
middleware because it gets the processid
. Unfortunately thebefore
middleware does not. It'd be great if it did! :)Package Version: Dojo 5
Code
Here's the example middleware. It needs to be created via a function to provide the id to
before
.It's currently used like this
The Login container uses state created by this middleware to get error messages automatically and know when the process is loading and disable the login button.
Expected behavior:
If the process
id
was provided tobefore
I could create a genericrequestMiddleware
and use it as such:this would eliminate accidentally passing the wrong
id
when creating the middleware and obviate the need for the middleware factory, not to mention it should be an easy PR to addid
here https://github.com/dojo/framework/blob/master/src/stores/process.ts#L178The text was updated successfully, but these errors were encountered: