active-group / active-group/reacl

`xpath/select-all` shouldn't be evaluated lazily

Aberta
#46 1 comentário 0 reações 1 responsável Reivindicada por @smoes Ver no GitHub
Linguagem predominante
Clojure
Estrelas
78
Forks
2
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

In the following example the behavior of `xpath/select-all` seems unintuitive because of lazyness:

```
(let [comp (tu/mount a-div-containing-component)
divs-before (xpath/select-all comp (xpath/>> ** "div"))
comp (send-message!! comp :destroy-all-divs)]
(assert (pos? (count divs-before))))
```

Assuming the `div-containing-component` contains at least one div before sending the message and zero after. `divs-before` returns an empty list, since the query is evaluated after all divs where destroyed. That said, the assertion will fail. Wrapping it in `(doall (xpath/select-all ...))` fixes the problem.

I'd expect `xpath/select-all` to be evaluated eagerly.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.