re-frame best practices question

677 views
Skip to first unread message

Александр Шер

unread,
Jun 22, 2015, 2:30:48 PM6/22/15
to clojur...@googlegroups.com
Hello all! I have idiomatic question about re-frame. What is the best practice creating forms in re-frame? As example simple case -- login/register form in big SPA application (with validation, etc.)

simon lomax

unread,
Jun 23, 2015, 10:58:27 AM6/23/15
to clojur...@googlegroups.com
You could take a look at this http://bilus.github.io/reforms/ library that has recently been released. The reagent forms are what you want for re-frame.

Александр Шер

unread,
Jun 23, 2015, 12:27:03 PM6/23/15
to clojur...@googlegroups.com
On Tuesday, June 23, 2015 at 5:58:27 PM UTC+3, simon lomax wrote:
> You could take a look at this http://bilus.github.io/reforms/ library that has recently been released. The reagent forms are what you want for re-frame.

Your mean that I need to use reforms (or reagent-forms) beside re-frame app-db? And in {:on-click } Submit button handler gather data from reforms local atom and send it to re-frame handler?

simon lomax

unread,
Jun 23, 2015, 1:12:16 PM6/23/15
to clojur...@googlegroups.com
Yes, you could use the reforms library together with re-frame (forms in re-frame are actually Reagent forms). The on-click's can be used to dispatch events to handlers that update the app-db and use subscriptions in your forms (that you can build using reforms). See the re-frame readme for details.

I haven't used reforms yet - its very new, but I'm planning on using it as I've described.

Hope this helps
 

--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/--mp1aptVOs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

simon lomax

unread,
Jun 23, 2015, 5:05:50 PM6/23/15
to clojur...@googlegroups.com
You could also check out re-com https://github.com/Day8/re-com

Marcin Bilski

unread,
Oct 19, 2015, 6:29:53 AM10/19/15
to ClojureScript
On Tuesday, June 23, 2015 at 11:05:50 PM UTC+2, simon lomax wrote:
> You could also check out re-com https://github.com/Day8/re-com

It's better late than never so for anyone who may come across this thread, here's a simple example of using re-frame (with re-com) along with reagent-reforms:

https://github.com/bilus/re-frame-re-com-example

Reply all
Reply to author
Forward
0 new messages