Comments (7)
I've manage to made a sample redux-form
integration. Here is the repo https://github.com/jmarceli/redux-elm-form. If you will have some spare time please take a look and tell me if it suits you. If so I can make some pull requests to the documentation section and explain the integration. Probably there should be separate chapter called "Integration with other packages" or something like that.
I know that storing forms outside regular Elm tree is not the way it should be handled but this is the only (successful) way of integrating redux-form
(I have no luck with trying to make separate form for each component - but it might be possible).
A couple of issues I come across while making this sample app:
- view has to be wrapped with
redux-elm/view
in other case sagas won't be triggered (it might be worth documenting, if it's not yet documented) - forms created with
redux-form
are not hot reloaded, they loose all entered data during reload (I don't know how to fix this) - forms needs unique names, they should be somehow generated in the same way as action types, but I still didn't find any way to do this, so it is up to the developer for now
- form data is not accessible in the updater so it has to be passed with the action, it may be possible to use redux-spy but I have no need for this right now so I didn't check if it will work (and how to integrate this)
from prism.
Hello, I really appreciate what you did here. I am working on this issue today and came to basically same implementation. However, I am not sure how much aware you are of v6
of redux-form
since there will be many breaking changes which will basically not allow this approach.
My main concern is that in v6, only fields will be connect
ed not the entire form
, the issue is though that there's no simple way to provide the field with wrapped dispatch function. I am thinking about filing an issue to redux-form
repo.
from prism.
Hi. I'm aware that it will be v6 but I didn't check how much changes it will bring. It's definitely good idea to submit an issue, but I don't know if eventually it will be necessary to provide some Elm-compatible implementation of the forms (or some kind of adapter for redux-form
).
Offtopic question: Do you manage to run/deliver any production services based on redux-elm
? I'm asking because I have to write an app for the client and composability of the Elm Architecture seems to be a good solution.
from prism.
@jmarceli after deep understanding of how redux-form
works I've decided to send a PR, redux-form/redux-form#1154 let's see where it gets us.
OT answer: Yes, we are in the middle of implementing universal web app which is using redux-elm
and so far we are happy with the architecture.
from prism.
Thanks for handling this issue. I think that my current level of knowledge won't allow me to create valuable pull request for redux-form
project.
from prism.
@tomkis1 maybe I solve the redux-form v6 issue without any modifications to the library. Please take a look at: https://github.com/jmarceli/redux-elm-form/tree/redux_form_v6
I'm not sure if wrapping a form in subcomponent solves all the issues but it allows me to handle form submit with redux-elm custom dispatcher (which was the problem as far as I know).
from prism.
So we've come up with a conclusion that redux-form
is quite opinionated library even in plain redux
which makes it even more difficult to integrate with redux-elm
. Maybe more focused library would do the trick better.
from prism.
Related Issues (20)
- Don't Call PropTypes HOT 3
- Sibling components interaction best practice HOT 6
- Performance HOT 2
- Request to join cdnjs HOT 1
- Build a umd package for Browser usage
- Reduce bundle size by using rxjs modularity HOT 1
- Mount order and saga registering HOT 8
- Get currentUser state in component Updater HOT 3
- Sagas not getting unmounted HOT 2
- Version 4.x.x HOT 7
- redux-saga update HOT 2
- Documentation links 404 HOT 5
- Where is documentation for v3? HOT 2
- Props 'selector' and 'wrapper' get passed down to enhanced component HOT 3
- prism-redux/escapeRegexp.js is missing a character in the regex
- Questions about using side-effect libraries with prism
- How to wrap/unwrap dynamic components? HOT 2
- Provide a wrapper compatible with the library-provided unwrapper
- EnhanceComponent doesn't work with thunk middleware
- Dynamic list of stateful components HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prism.