Fork me on GitHub

guys any nice way to do loading in re-frame?


per component loading


so I don’t have to keep writing loading handlers for each component


@shyambalu: Could you post an example of what you’re doing now? Should make it a little easier to help.


@shaun-mahood: something like this login handler -> makes ajax call -> sets loading true in app db login response handler (gets called from successful ajax response) -> sets loading false in app db


need a way to abstract this out


and separate parts of the app and be loading simultaneously so can’t only have one loading state in app-db


@shyambalu: If you’re using v0.8.0, there are some things that should help in the new docs - - particularly the sections on effectful handlers and populating your application data. If things are still unclear or you have any specific questions please ask - we’re trying to get the documentation as good as we can so any areas of confusion will still help. If you’ve already been through those docs and they didn’t help, let me know and I will see if I can come up with a more specific response or an example.


@shaun-mahood yep that looks perfect


although we are stuck at the previous version for the moment


but i’m starting to think more and more it’s worth the effort


@shyambalu: I think so - it seems like it solves a lot of the issues I’ve run into from earlier. Is your code base pretty big?


not that big 50,000 LOC


Big enough to make it a pain to change though I bet. If you don’t have any re-frame middleware, I think you should be able to update to the new version reasonably easily (change register-sub to reg-sub-raw, register-handler to reg-sub-db) - but I guess we should add a section to the docs specifically on how to update to v0.8.0 with some examples.