Skip to content

[7.x] Endpoint: middleware receive immutable versions of state and actions (#63802)#63887

Merged
oatkiller merged 2 commits intoelastic:7.xfrom
oatkiller:backport/7.x/pr-63802
Apr 22, 2020
Merged

[7.x] Endpoint: middleware receive immutable versions of state and actions (#63802)#63887
oatkiller merged 2 commits intoelastic:7.xfrom
oatkiller:backport/7.x/pr-63802

Conversation

@oatkiller
Copy link
Copy Markdown
Contributor

Backports the following commits to 7.x:

…lastic#63802)

Middleware receive state and actions, but they shouldn't mutate either. With this PR, middleware using the `substateMiddlewareFactory` helper will have this enforced via typescript.

* replace `MiddlewareFactory` with `ImmutableMiddlewareFactory`
* Added types: `ImmutableMiddleware` and `ImmutableMiddlewareAPI` which are similar to the ones built into redux but which enforce that state and actions aren't mutated (and which allow `Immutable` versions of actions to be dispatched.

No changes to runtime code.
@oatkiller oatkiller added backport This PR is a backport of another PR Feature:Endpoint Elastic Endpoint feature release_note:skip Skip the PR/issue when compiling release notes v7.8.0 v8.0.0 labels Apr 17, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/endpoint-app-team (Feature:Endpoint)

@oatkiller
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@oatkiller oatkiller merged commit a35d220 into elastic:7.x Apr 22, 2020
@oatkiller oatkiller deleted the backport/7.x/pr-63802 branch April 22, 2020 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Feature:Endpoint Elastic Endpoint feature release_note:skip Skip the PR/issue when compiling release notes v7.8.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants