Redux saga uses the prompt type mismatch in axios,TS

api.tsx

import http from "./http"

export default {
  common: {
    login(username: string, password: string) {
      return http.post("/common/login", {
        username,
        password,
      })
    },
}

where http is the axios configured encapsulated export.
then you can"t take parameters with you when you write an axios request in saga. How do I write
?

Jul.05,2022

functions that return Promise can be directly yield in the Effect of D.Va encapsulated by Redux and Redux-Saga . In this example, it can be written as:

const res = yield api.common.login(defaultState.username, defaultState.password);

so it is speculated that Redux-Saga itself should also be supported.

however, the problem is that the yield keyword of the current version of TypeScript does not support type inference. In this case, the type of res will be any.

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-1c1aff8-33243.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-1c1aff8-33243.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?