The method in Ant Design Pro Model's effects has the same name, resulting in an infinite loop. what is the reason for this?

the An and B codes of both models are the same, as follows:

export default {
  namespace: "A  B ",
  state: {}

  effects: { 
    *add({payload},  {call, put}){
        console.log("")
        yield put({
            type: "add",
            payload:{
                payload
            }
        });
    }
  },
  reducers:{
      add(state, action){
        console.log("state")
        return state;
      }
  }
};
When using

, it is not introduced at the same time. When I call a component, I print the above two contents in an endless loop.

if I am not in effects call put , there will be no endless loop.
I would like to ask all of you to answer the reason for this. Thank you.

Mar.20,2021

the add in your effects calls add, himself. If you don't use put, you won't call add. Of course, you won't have a dead loop.


Don't repeat your name. Thank you. There are more saveXxx operations in reducers.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea1c1a-1b85.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea1c1a-1b85.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?