Procédure de rendu d'appel depuis l'action React-Redux (Electron)

J'ai une application électronique qui utilise React & Redux, donc j'ai des créateurs d'action, des réducteurs, etc.

J'ai également une fonction dans mon fichier de rendu (nodejs) qui fait des choses asynchrones.

Je veux appeler cette fonction à partir de mon créateur d'action. Je suppose que je devrais utiliser redux-thunk pour cette ou une autre bibliothèque asynchrone, mais je ne sais pas très bien comment accéder à cette fonction dans le processus de rendu et l'utiliser dans mon application reac.redux?

Donc, par exemple pour le créateur d'action:

export const downloadFromYoutube = (download) => { //I want to call the function here }; 

Et mon fichier de rendu ne contient que cette fonction qui fait du matériel asynchrone:

 var YoutubeMp3Downloader = require('youtube-mp3-downloader'); function downloadFromYoutube() { console.log("Hello"); //Configure YoutubeMp3Downloader with y our settings var YD = new YoutubeMp3Downloader({ "ffmpegPath": "/usr/local/Cellar/ffmpeg/3.2.2/bin/ffmpeg", // Where is the FFmpeg binary located? "outputPath": "/Users/dominik/Coding/youtube-downloader-papa/downloads/", // Where should the downloaded and encoded files be stored? "youtubeVideoQuality": "highest", // What video quality should be used? "queueParallelism": 2, // How many parallel downloads/encodes should be started? "progressTimeout": 2000 // How long should be the interval of the progress reports }); console.log("Downloading"); //Download video and save as MP3 file YD.download("jhjPSj-qnyg"); YD.on("finished", function(data) { console.log(data); }); YD.on("error", function(error) { console.log(error); }); YD.on("progress", function(progress) { console.log(progress); }); } }