title | description | jsdoc | contentsHeading | ||
---|---|---|---|---|---|
Actions |
Documentation on actions and how they help you manipulate state within Gatsby |
|
Functions |
Gatsby uses Redux internally to manage state. When you implement a Gatsby API, you are passed a collection of actions (equivalent to actions bound with bindActionCreators in Redux) which you can use to manipulate state on your site.
The object actions
contains the functions and these can be individually extracted by using ES6 object destructuring.
// For function createNodeField
exports.onCreateNode = ({ node, getNode, actions }) => {
const { createNodeField } = actions
}