const apihandler = (code, successData, errorData, cb = null) => {
  return new Promise((resolve, reject) => {
    if (code === "0000") {
      cb && cb(successData);
      resolve({ data: successData, isSuccess: true });
    }
    resolve({ ...errorData, isSuccess: false });
  });
};

export default apihandler;
