specter

Latest version: 1.1.3
roklenarcic 2019-01-10T11:41:13.031900Z

I'm having problems expressing the following: I want to find an element in the vector, and edit that, but if it doesn't exist I want to add a default element to the vector

nathanmarz 2019-01-10T15:52:57.032200Z

@roklenarcic you can do this:

(multi-transform
  [(if-path [ALL (pred= :a)]
     [ALL (pred= :a) (terminal-val :c)]
     [AFTER-ELEM (terminal-val :DEFAULT)]
     )]
  [:b :a :b])

nathanmarz 2019-01-10T15:53:06.032500Z

can probably do it more efficiently with a custom navigator