diff --git a/docs/api/utils.md b/docs/api/utils.md new file mode 100644 index 0000000000..c85a345fe3 --- /dev/null +++ b/docs/api/utils.md @@ -0,0 +1,22 @@ +--- +id: utils +title: Additional Utilities +hide_title: true +description: 'API > utils: Additional utility functions' +--- + +  + +# Utility Functions + +The Redux core exports additional utility functions for reuse. + +## `isAction` + +Returns true if the parameter is a valid Redux action object (a plain object with a string `type` field). + +This also serves as a TypeScript type predicate, which will narrow the TS type to `Action`. + +## `isPlainObject` + +Returns true if the value appears to be a plain JS object. diff --git a/website/sidebars.js b/website/sidebars.js index ffa534748e..51e4334b80 100755 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -151,6 +151,7 @@ module.exports = { 'api/applymiddleware', 'api/bindactioncreators', 'api/compose', + 'api/utils', { type: 'link', label: 'Error Messages', href: '/errors' } ], 'Redux Toolkit': ['redux-toolkit/overview']