AhKi / oh-my-desk

web widget desktop application
GNU General Public License v3.0
74 stars 11 forks source link

Should controllers be used in the main process? #136

Closed HyunmoAhn closed 5 years ago

HyunmoAhn commented 5 years ago

Description

We use Controller in main process.

I thought that we may not have to use it.

Why are we using a Controller?

Electron is separated section about main and renderer. Some Electron method must be used in main process, not renderer process. If we execute it in renderer process, It make error!

What does the controller do?

Controller locate in main process. It is subscribing action type and run side-effect matched action type that dispatched.

Should controllers be used in the main process?

Is there a good way to replace a controller?

HyunmoAhn commented 5 years ago

What about redux-thunk?

redux-thunk is library that make action from object to function.

If we can dispatch all code that must run in main process using redux-thunk, we don't need to use controller because we just dispatch action that is made by redux-thunk and transmit it and run it!

Consider