Skip to content

lasagna-pull cannot pull all map keys or values #75

@flybot-nam-nguyenhoai

Description

@flybot-nam-nguyenhoai

Problem

When pulling data from a map, lasagna-pull requires all map keys to be provided up front. There is no way to discover all map keys or all map values. For example:

(def entity-map
  {#uuid "123456" {:attr1 :v1 :attr2 :v2}
   #uuid "234567" {:attr1 :v3 :attr2 :v4}})

;; There is no way to pull [#uuid "123456", #uuid "234567"] or [{:attr1 :v1}, {:attr1 :v3}].

Impact

It is difficult to work with index–entity maps in which indexes (keys) are generated dynamically, like entity-map above.

These maps are common when working with UI entities in re-frame.

Suggestion

  • Implement patterns for pulling all map keys or values, similar to Specter’s MAP-KEYS and MAP-VALS, respectively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions