Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

A single atom for all input fields #2

Closed
murtaza52 opened this Issue · 8 comments

2 participants

@murtaza52

Hi,

Is it possible to bind a single atom to all the fields in a form. The atom would be a map and each key in the map will correspond to the respective input id's in the form.

From the examples I gather that an atom will have to be defined for each input field, rather than one atom for all fields. Is that possible?

Thanks,
Murtaza

@mjtodd
Owner

Hi,
Firstly, sorry for not spotting this issue sooner. It isn't currently possible to bind a single atom to all fields in a form. It is a great idea though, and I will look at implementing this shortly.

Matt

@mjtodd mjtodd closed this in 240f099
@mjtodd
Owner

Hi,
I have added support for this, updated the readme and also added a maptest example. I have pushed the latest code to clojars, so 1.0.0-SNAPSHOT now contains this addition.

Please do let me know if this change meets your requirements.

Regards,
Matt

@murtaza52
@mjtodd
Owner

Hi,
I am looking into ways to either evolve cljs-binding in that direction, or build upon it to provide more facilities for client-side clojurescript / html generation, and synchronisation of state between browser, and server.

If you had any suggestions on what features you would find useful, they would be gratefully received.

Thanks,
Matt

@murtaza52
@murtaza52
@murtaza52
@mjtodd
Owner

That's ok. It's great to have some feedback.

I have been looking at using hiccup/crate. I think crate combined with some functions that make the binding easier could be a useful addition to the library.

I'm thinking something along the lines of a function that can be called, passing in an atom that will generate html using crate based on a template function passed in. The generated elements would automatically have all bindings wired up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.