Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 793 Bytes

actions.md

File metadata and controls

19 lines (16 loc) · 793 Bytes
title description jsdoc contentsHeading
Actions
Documentation on actions and how they help you manipulate state within Gatsby
src/redux/actions/public.js
src/redux/actions/restricted.ts
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
}