-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dealing with calling native libs from aliased actions #92
Comments
Looking at: triggerAlias.js and createAliasedAction.js We just have a dynamically created alias registry I have worked with react-chrome-redux and it's the same concept but has a fixed manually created alias registry https://github.com/tshaddix/react-chrome-redux#3-optional-implement-actions-whose-logic-only-happens-in-the-background-script-we-call-them-aliases I think a simple change like this to support manual additions to the registry would be able to solve this problem @hardchor any interest in adding this type of functionality to |
Hey @paulius005 (and @percyhanna). Time electron-redux receives some much-needed love. I'm sure you've long since moved on, but I'd still like to pick this up (and be it for future readers / contributors). Code separation is definitely an issue when it comes to aliased actions. I was never really happy with the implementation, and fixing this might require a completely different approach (I'm really just throwing around empty phrases - I have no idea how right now). |
Hi @hardchor, we have an issue related to this. The When using webpack with target Do you have a recommended way to get around this. A simple update in the code would be to remove the dependency on the assert module and just throw an error if the current expressions inside the current asserts are false. |
If this helps anyone, this is the code that we ended up writing to get around this:
Essentially we use the concept of aliases from webext-redux to separate out the concerns of the renderer and the main process |
createAliasedAction
is there so we can call action creators, or promises to run only on the main process. However, one still has to import that function into the shared actions file even though it only runs on the main process.This can be problematic in the case that the thing that's supposed to only run on the main process contains native libraries, which if imported into the shared action file will get compiled with the renderer code.
What is the proposed way of getting around this?
Here is a video explanation as well: https://www.useloom.com/share/32eebc9d4e4a43c5b3f57da3fbbe44bc
The text was updated successfully, but these errors were encountered: