Giter Club home page Giter Club logo

Comments (6)

sync-by-unito avatar sync-by-unito commented on July 24, 2024

➤ PM Bot commented:

Jira ticket: RJS-2827

from realm-js.

kneth avatar kneth commented on July 24, 2024

@maierphilipp

Are you able to retrieve the subscription with realm.subscriptions.findByName("listSub")? Moreover it is interesting if the subscriptions have been download by checking realm.subscriptions.state.

from realm-js.

maierphilipp avatar maierphilipp commented on July 24, 2024

Thanks for your Response! I can now access the initial-sub with .findByName("listSub"). This hasn't worked before.

{"internal": {"createdAt": {Symbol(Realm.Timestamp.external_pointer): [Object]}, "id": "6657f074b58fcbdade05afba", "name": "listSub", "objectClassName": "ShoppingList", "queryString": "TRUEPREDICATE", "updatedAt": {Symbol(Realm.Timestamp.external_pointer): [Object]}}} gets logged to the console.

The State says "complete". I now encountered a new error. I am not able to subscribe to the query with the above code because .subscribe() is not a function but undefined. From where do I have to import it?

Sorry I really struggle with the subscriptions..

from realm-js.

nirinchev avatar nirinchev commented on July 24, 2024

It's not clear to me how you've been able to create listSub if you say .subscribe is not a function? It sounds like at least once the code has run successfully in order to create the subscription. Can you create an isolated repro case for what you're seeing and share it here?

from realm-js.

maierphilipp avatar maierphilipp commented on July 24, 2024

@nirinchev as mentioned above I subscribed to my ShoppingList as an initialSub. This is not the solution I was expecting, as I have multiple initial subs right now, but I didn't get the problem solved otherwise. ".subscribe() is not a function".

from realm-js.

nirinchev avatar nirinchev commented on July 24, 2024

The commented-out code for initialSubscriptions doesn't seem to assign a name, meaning it would create an unnamed subscription rather than one called listSub. In any case, without a clear repro case, it's kind of hard to debug things over github. The subscribe function is defined on Realm.Results - what is the type of list when createSubscription is invoked?

from realm-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.