Added base handled for job decode and watcher start/top
This commit is contained in:
37
src/ipc/ipc-renderer-handler.js
Normal file
37
src/ipc/ipc-renderer-handler.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import ipcTypes from "../ipc.types";
|
||||
import {
|
||||
setWatchedPaths,
|
||||
setWatcherStatus,
|
||||
} from "../redux/application/application.actions";
|
||||
import { store } from "../redux/store";
|
||||
const { ipcRenderer } = window;
|
||||
|
||||
console.log("----Initializing IPC Listeners in React App.");
|
||||
|
||||
ipcRenderer.on(
|
||||
ipcTypes.default.fileWatcher.toRenderer.filepathsList,
|
||||
(event, ...obj) => {
|
||||
store.dispatch(setWatchedPaths(obj));
|
||||
}
|
||||
);
|
||||
|
||||
//Filewatcher Section
|
||||
ipcRenderer.on(
|
||||
ipcTypes.default.fileWatcher.toRenderer.startSuccess,
|
||||
(event, ...obj) => {
|
||||
store.dispatch(setWatcherStatus("READY!"));
|
||||
}
|
||||
);
|
||||
ipcRenderer.on(
|
||||
ipcTypes.default.fileWatcher.toRenderer.stopSuccess,
|
||||
(event, ...obj) => {
|
||||
store.dispatch(setWatcherStatus("STOPPED"));
|
||||
}
|
||||
);
|
||||
|
||||
ipcRenderer.on(
|
||||
ipcTypes.default.fileWatcher.toRenderer.error,
|
||||
(event, ...obj) => {
|
||||
store.dispatch(setWatcherStatus(obj));
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user