Fork me on GitHub
#re-frame
<
2024-04-16
>
Harun04:04:36

Just getting started with re-frame by reading the excellent docs. I am now reviewing the todomvc app, but don't understand why 'db' is destructured in the event handler which initializes db. Shouldn't the function be written like this?: (reg-event-fx :initialise-db [(inject-cofx :local-store-todos) check-spec-interceptor] (fn [{:keys [local-store-todos]} _] {:db (assoc default-db :todos local-store-todos)})) Am I missing something?

p-himik08:04:25

The code in the repo has an unused binding created by the destructuring, yes. Not a big deal, doesn't affect anything.