Sagas aren't being triggered, EFFECT_TRIGGERED only at startup
See original GitHub issueI had sagas set up in my app, handling side effects. I hooked up the saga middleware to my store, passing in the rootSaga
, and was successfully executing a side effect in response to an action. I committed this code, then proceeded to add another side effect to respond to a different action. This worked as well, and I committed it.
Now when I run my code, at startup I see EFFECT_TRIGGERED
twice followed by EFFECT_RESOLVED
twice, but other than that, the sagas are never triggered in response to the actions they’re set up to watch. I thought that was bizarre, so I reverted to a previous commit where I know the sagas’ side effects were working, and it too has this odd behavior. I then reverted to the first commit where I set up sagas, and it too isn’t working.
Do you have an idea what could cause such behavior? I’ve compared my sagas and store to those in the examples, and they look fine. Since my saga and store code were working fine before, but stopped working (without me changing them, or any underlying libraries), I’m thinking the issue has to be caused by something related to my development environment. I tried setting up the development environment of the app on a different computer, reinstalling node_modules
from scratch, and it’s having the same issue. If you have any idea what could be causing this issue, I’d greatly appreciate it.
I’m using redux-saga 0.9.1
Issue Analytics
- State:
- Created 8 years ago
- Comments:20 (6 by maintainers)
Top GitHub Comments
@tsemerad what solution had you adopted
Hi, @neurosnap , thanks for your response, I am dispatching the action from the
component.
below is the code// import statements import React, { useEffect } from “react”; import { connect } from “react-redux”; import { Card, CardBodyHeader } from “…/…/…/…/…/…/Common/components/General”; import { getUser } from “…/…/…/saga/sagaActions”;
// control for managing risk selection const AddressBICovers = (props) => { props.fn_getUser(); useEffect(() => {}, []); return ( <React.Fragment> <div className="main-content" id="divRiskSelection"> <section className="section"> <div className="row"> <Card cardSizes={[“col-12”]} cardColor=“card-primary” cardId=“riskSelectionCard” cardShowHide={true} cardHeaderText=“Bussiness Interruption Covers” animateCard={true} hasRateButton={true} handleOnRateClick={props.rateRiskSasria} showCardFooter={props.isLoading === true ? false : false} cardFooterTextArray={props.isLoading === true ? [] : []} // showWarningCardFooter={cardWarningFooterTextArray.length > 0} // cardWarningFooterTextArray={cardWarningFooterTextArray} > <div className="form-group"> <div className="row"></div> </div> </Card> </div> </section> </div> </React.Fragment> ); };
// map dispatch to props const mapDispatchToProps = (dispatch) => { return { fn_getUser: () => { return dispatch(getUser); }, }; };
// map state to props const mapStateToProps = (state) => { return { addressActiveOIKey: state.sidebarData.activeaddressOI, }; }; // component prop type validation AddressBICovers.propTypes = {};
// export redux connected component export default connect(mapStateToProps, mapDispatchToProps)(AddressBICovers);