Generator functions are more flexible and can be used for yielding different things depending on the number of times it gets used. Pagination of some sort comes to my mind. Here are some examples of generator functions that would be trickier to implement using
'yield' will wait until generator is unrolled to this 'yield' iteration.
The idea of saga generator (worker) is to generate special functions (so called 'effects') using effect creators (put, call etc), not just do something. This allows to orchestrate function calls.
See also Redux Saga async/await pattern
- Redux saga: What is the difference between using yield call() and async/await?
- what is difference between using and not using call method in redux saga?
- What is the difference between Redux Thunk and Redux Saga?
- What is the main difference between using React-Redux Hooks and React-Redux Connect()?
- What is the difference between arrow functions and regular functions inside React functional components (no longer using class components)?
- What is the difference between using redux-thunk and calling dispatch() directly
- What is the difference between using extract-text-webpack-plugin and linking a merged CSS file in an HTML header?
- What is the difference between using only paranthesis and curly braces within paranthesis while defining function in ReactJS?
- What is the difference between [...arr, addThisElement], and arr.push(addThisElement) when using useState in ReactJS?
- What is the actual difference between using an inline-style and using a css-in-js library like styled components in React?
- What is the difference between using setItem to set multiple state values and using useEffect to do so?
- In React, what is the difference between using functional component and just a function, which returns React node?
- What is the difference using return a function and call the function
- What is the difference between this.function and function call in React
- What is the difference between using this.props and props in React.js?
- What is the difference between domElement and pageContext when using them within an spfx react project?
- What is the difference between component prop and using children in Route?
- What is the correct way to do an async action using redux observable and firebase?
- What is the difference between React Native and React?
- What is the difference between state and props in React?
- What is the difference between using constructor vs getInitialState in React / React Native?
- What's the difference between "super()" and "super(props)" in React when using es6 classes?
- What is the difference between HashRouter and BrowserRouter in React?
- What is the difference between .ts and .tsx extensions. Both are used as extensions for typescript files in react. So where should we use them?
- What is the difference between redux-thunk and redux-promise?
- What is the difference between componentWillMount and componentDidMount in ReactJS?
- What is the difference between NextJs and Create React App
- What is the difference between jest.fn() and jest.spyOn() methods in jest?
- What is the technical difference between .jsx and .js files
- What is the difference between hashHistory and browserHistory in react router?
More Query from same tag
- Conflict while rendering nested components with React Router 4
- how to fix css of video.js package in reacttjs
- Actions may not have an undefined "type" property. Have you misspelled a constant in reactjs,redux
- send Data from react to django rest api
- How to load external svg file in `SvgIcon` in material-ui?
- How to re-use HTML component wrapper in a sequence of child components?
- React function enter twice in if condition inside Map function
- How to require an additional charge for the first-time users in stripe subscription?
- How can I load a key value pair array into state, by pulling data from a json file?
- Todo React JS App 1
- reactjs have function run repeatedly
- CORS giving issues once I went from localhost --> heroku
- Fetch data on Async ComponentDidMount before rendering
- test antd <Select/> using jest
- Babel - Cannot read property 'TYPED_ARRAY_SUPPORT' of undefined
- Show Loading for axios Post request
- Setting initial state array
- Redux state not updating right away?
- How to get origin or domain name in Next.js
- Delay Api call inside componentDidUpdate
- TypeError: employee.push is not a function
- Typescript and eslint issue when using styled-components and Material UI: `React does not recognize the `showText` prop on a DOM element`
- What should I use as a key for "row" elements in react?
- Multiple scss Files Referencing One Main Style File
- Passing a variable to the React useCallback hook
- Material-UI Next js Link Button
- How can I pass array values to another component?
- Type '(props: Props) => Element' is not assignable to type 'FunctionComponent<FieldRenderProps<any, HTMLElement>>' with React-final-form
- Expose a function from a functional component - React
- React useState in functional components not updating the property values immediately