Tips to build a Todo app with react, redux-saga, typescript and react-bootstrap — 2

Actions
Soldier folllows the order
soldier is wait for the order
Commander orders moveToVillage

localStorage.setItem(TODOS, JSON.stringify(todos));

clean saga
Test save
import * as redux from 'react-redux'

const spy = jest.spyOn(redux, 'useSelector')
spy.mockReturnValue({ username:'test' })
jest.mock('react-redux', () => ({
useSelector: jest.fn(),
useDispatch: () => mockDispatch
}));

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store