`initialSubscription` should also provide `user` to its callback

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Realm React

      When using the initialSubscription configuration for realm, it is very likely that the current user will be used to filter the flexible sync data. It would be great if the currentUser was also provided in the callback. Otherwise, an underlying component will have to setup the subscription to filter on user data.
      Ideal scenario:

      Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
       <RealmProvider
              sync={{
                flexible: true,
                initialSubscriptions: {
                  update: (subs, realm, user) => {
                    // subscribe to all of the logged in user's to-do items
                    subs.add(realm.objects('Item').filtered(`owner_id == ${user.id}`), {name: 'ownItems'});
                  },
                },
              }}/>
      

            Assignee:
            Unassigned
            Reporter:
            Andrew Meyer
            Archiver:
            Marc Greenfield

              Created:
              Updated:
              Resolved:
              Archived: