-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Realm React
-
Labels:
-
2 - S (<= 1 week)
-
4974
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'}); }, }, }}/>