acdlite / acdlite/react-rx-component

Ref as an observable

Aberta
#5 17 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
JavaScript
Estrelas
83
Forks
4
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

This came up today trying to pass a `funcSubject` as a ref callback function. Because we're not actually subscribed when the ref callback fires (ie before `componentDidMount`), the value is just kind of lost.

Using a BehaviorSubject instead fixed the issue, but I thought I'd mention it for anyone else who ran into it.

Also I was wondering why you subscribe in componentDidMount and not the constructor? It seems like it potentially adds some unnecessary work. I imagine it's a "universal" thing but I don't have any experience with that...

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.