question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

watermelon update not triggering observable

See original GitHub issue

I’m running into an issue where I have 2 screens in react-native.

I’m observing the changes to this collection on a list view screen, and preforming item creation/updates on the second screen. Any creation that occurs is reflected on the list view, however when I preform an update to an item it doesn’t reflect on the list view. I’m at a loss currently and if there’s any more information/clarity I could provide please let me know.

const Screen = withDatabase(
  withObservables([], ({ database }) => ({
    games: database.collections
      .get('games')
      .query()
      .observe(),
  }))(SummaryListScreen)
);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
radexcommented, Mar 25, 2019

@mikebeyer You confuse two similar, but also very different things — observing a model/record (like Post in the quoted example), and observing a query (a list of things).

Note https://github.com/Nozbe/WatermelonDB/blob/master/docs/Components.md#reactive-lists :

However, observing the comments Query will not re-render <Post> if a comment is updated — we render the <EnhancedComment> so that it observes the comment and re-renders if necessary.

Observing list re-renders the list if necessary — but each item should individually observe its corresponding record as well

0reactions
horlaarscocommented, Jul 21, 2020

Gotten it thanks…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connecting to React Components - WatermelonDB ...
withObservables is a general-purpose HOC for Observables, not just Watermelon. You can create new props from any Observable . Advanced: observing sorted lists....
Read more >
I am successfully displaying my data using "withObservables ...
I am successfully displaying my data using "withObservables()" method but it's still not reactive to my component in WatermelonDB.
Read more >
Thinking in nested streams with RxJS - Rangle.io
Working with nested data structures. One of my experiments with RxJS was traversing directories of files on my computer and returning a single ......
Read more >
Observer Blocks don't detect melon/pumpkin stem updates.
The observer blocks notice all of the stages of the stems growing, but after the stem is fully grown the observer block does...
Read more >
A Few Functional Uses for Intersection Observer to Know ...
You might not know this, but JavaScript has stealthily ... to check whether Intersection Observer is supported while you're working with it, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found