Click in order · JavaScript and React course · Module 4: Context API and useReducer
Action Creators
Arrange the space action creators:
Items to click
- };
- launchShip: (ship) => ({ type: 'LAUNCH_SHIP', payload: ship }),
- const spaceActions = {
- updateEnergy: (amount) => ({ type: 'UPDATE_ENERGY', payload: amount }),
- setMission: (mission) => ({ type: 'SET_MISSION', payload: mission })
You can check the correct answer by solving this task in the CodeWorlds game.