Git Product home page Git Product logo

Comments (6)

viskin avatar viskin commented on August 22, 2024 1

Sorry that I intervene, but I don't think that "actions should be serializable" is limitation of react-chrome-redux.
As mentioned in this discussion, actions in redux should be plain objects. So creating not serializable actions is limitation of libraries that do that.
Maybe it really worth noting the fact of serializablility of actions in "reminder" section. Again, in my option, it's not limitation but conformance to redux architecture.

from webext-redux.

mironov avatar mironov commented on August 22, 2024

@viskin It is not a limitation of react-chrome-redux but of Chrome Extension Messaging API:

A message can contain any valid JSON object (null, boolean, number, string, array, or object).

The Redux app might work without a problem on the web or mobile (with react-native), but when you start porting it to the Chrome ecosystem you will encounter unexpected behavior. Moreover, there are no errors; actions just come to the background page without "non-serializable" fields.

redux-thunk async actions also can't be serialized, so the aliases hack exists. Probably we can re-use that trick for other middlewares, but we should at least highlight that in README.

from webext-redux.

tshaddix avatar tshaddix commented on August 22, 2024

@mironov Have you looked into dispatchResponder? This was included to allow a "conversion" to a serializable object that the UI Components understand. The bottom example is an example with redux-promise-middleware. Please let us know if this helps (or not)!

from webext-redux.

tshaddix avatar tshaddix commented on August 22, 2024

Also, I'm happy to work with someone on the README sections. Right now it exists as a collection of wiki links.

from webext-redux.

mironov avatar mironov commented on August 22, 2024

@tshaddix Oh wow! Sorry, I overlooked this example somehow.

I think the easiest thing to do is to change headers to "Usage with redux-thunk" and "Usage with a promise middleware" on the Advanced Usage page.

Feel free to close the issue since the workaround is already documented.

from webext-redux.

tshaddix avatar tshaddix commented on August 22, 2024

@mironov, great to hear!

I agree we should probably breakout the Readme sections into something a little more recognizable. I would like to keep the documentation package-agnostic. Ideas?

from webext-redux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.