How to control the socket link established by the subscriptions of dva to run after obtaining certain data

subscriptions: {
    socketGetMessage({ dispatch }) {
      return getMessage(data => {
        const datajson = JSON.parse(data);
        dispatch({
          type: "notice/fetch_mqtt_add",
          payload: datajson
        });
      });
    }
 }
The method in

subscriptions executes

when app.start ()

let client;
export async function getMessage(action) {client = connect(mqttUrl, {
    clientId: terminalUid,
    ...mqttSetting // 
  });

  client.on("connect", () => {
       console.log(":" + client.connected);
  });

  client.on("message", (topic, message, packet) => {
    action(message.toString());
  });
}
    

but the user configuration parameters needed to establish a socket link need to asynchronously request an API to get
, while subscriptions executes
when dom ready. Is there any good way to get the user"s setting parameter and then initiate a socket connection

?
Mar.02,2021

Open a websocket in subscriptions .
and then trigger a effects in onmessage of websocket .

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