Introducing the application state
After this brief tour into Redux, we will apply the newly obtained knowledge in practice. First, we will install the redux
package:
npm i -S redux
We will also use the additional helper library redux-act
(https://github.com/pauldijou/redux-act) to simplify the declaration of action creators and reducers. By using this library, we can use the action creator functions as references within reducers, abandoning the switch( action.type )
construction in favor of a shorter map syntax:
npm i -S redux-act
For screen capture, we should perform the following actions:
SET_ACTIVE_TAB
: It receives the identifier of the selected tabTOGGLE_RECORDING
: It receivestrue
when screencast recording starts andfalse
when it endsSET_SCREENSHOT_FILENAME
: It receives the output filename in the panel ScreenshotSET_SCREENSHOT_INPUT_ERROR
: It receives a message when an input error occursSET_ANIMATION_FILENAME
: It receives an output filename in the panel AnimationSET_ANIMATION_INPUT_ERROR...