Scratch Addons supports getting and modifying Redux state!

Keep in mind

  • Redux only applies on new page (ones with new navigation bar, including editor)
  • Some extensions conflict with ScratchAddons' Redux feature. Do not use this when unnecessary.
  • We expect readers to have basic knowledge on Redux and Scratch’s reducers.

Get redux state stores current Redux state. For example, to get message count:

Events"statechanged", callback) to add event listeners for state changes. The callback can have one argument which is a CustomEvent with following attributes:

  • action: Dispatched action. See Redux docs for what it means.
  • prev: Previous state.
  • next: Next state.

Dispatching event

You can dispatch events using Event object must have type attribute and can have other attributes. For details on what to dispatch, read reducer codes on scratch-www, scratch-gui or scratch-paint:

Last updated at 12 July 2021 by Hans5958 on commit d07183b. Improve this page.