This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-12
Channels
- # beginners (36)
- # boot (11)
- # cider (10)
- # cljs-dev (10)
- # cljsrn (3)
- # clojure (103)
- # clojure-greece (1)
- # clojure-italy (16)
- # clojure-nl (3)
- # clojure-spec (59)
- # clojure-uk (129)
- # clojurescript (125)
- # data-science (29)
- # datomic (30)
- # emacs (12)
- # events (5)
- # fulcro (61)
- # graphql (5)
- # keechma (3)
- # leiningen (9)
- # luminus (7)
- # onyx (26)
- # re-frame (3)
- # reagent (56)
- # reitit (25)
- # ring-swagger (16)
- # shadow-cljs (44)
- # spacemacs (4)
- # specter (2)
- # tools-deps (7)
- # vim (8)
@eric.shao What is the problem with this state img ? 🙂
if you're referring to "I want to load one {} or a [] to append to the initial-state’s list.", this one sounds like you should use post-mutation instead of target to implement this custom logic
Is the return from the server a map that contains the data needed for normalization (ident function on RepaymentItem)?
yes for sure, if I comment the {:fulcro {:started-callback (df/load)} 888 will not show in client.
oh, so your earlier question was “which comes first…“, right? So two are in initial state, and then you run a load in started
image2 is load from server and target(df/append), but the 888 ident is still there (not disappearing) and the 1 and 2 ident are turned into nil.
it is possible you found a bug…could be initial state and load are not playing right together…but darned if I can see why.
Try this just to be sure: Put your load
inside of a setTimeout
to defer it for a bit:
:started-callback (fn [app] (js/setTimeout (fn [] (df/load …)) 500))
It shows slower which is the same as the inspector’s history. First 1 and 2 is showing,then 888 is merged in ,and at the same time the [1 2] turned into nil.
@tony.kay https://github.com/EricShaoCN/daikuan/blob/try-semantic-ui/src/cards/daikuan/loan.cljs
https://github.com/EricShaoCN/daikuan/blob/try-semantic-ui/src/main/daikuan/ui/loan.cljc
@eric.shao I don’t see a problem with your code. I’ll open an issue and track it down.
I’m kind of glad. Does that count a contribute?😅 Maybe I will never contribute a thing because of my poor ability.
@eric.shao workaround…wrap the append to in multiple-targets
: (df/multiple-targets (df/append-to ..))
as the target…that works. I think perhaps I never tested the standalone append case, but always assumed it would be combined
proofreading contribution - there are two instances of "the the" on http://book.fulcrologic.com
also first list item under section 4.2.2 - "Fulcro provides a a built-in.."
are there docs on contributing to the docs?
another issue - not sure if it's as-designed, but if a component's query function returns a list instead of a vector, it won't validate.
not really that big a deal, but it wasn't obvious why. doing (reduce conj xs ys ..) instead of (concat xs ys ..) fixed it
nevermind, looking at the spec i see it's using the list/vector type to determine template/method
@chrisjswanson I’d love contributions to the docs…Just fork fulcro’s github repo, and edit DevelopersGuide.adoc
, then send a PR.
right on , will do
there is a nice plugin for IntelliJ that will let you preview as you edit, or you can use the Makefile to build the HTML (`make book`)
cool thanks, i'll check it out
:thumbsup:
anyone run into the issue with react where the cursor jumps to the end of an managed input? it prevents inserting text into the middle of a string, for example, because when the value changes it will re-render and the cursor position defaults to the end of the input field
looks like there may be workarounds to preserve and re-set cursor state before and after an update, but i'm wondering if there is a helper or a "fulcro way" to fix this
i still see one error for missing main.js , but everything looks fine anyways
@eric.shao So, I figured out the bug. Load has an old option called :marker
that historically defaults to “true”, but “true” means overwrite the target value with a load marker. I fixed it to give a warning on the case of special load targets (since the marker would overwrite the original vector), and turn the marker off. So, your original code should work with 2.5.9-SNAPSHOT.