-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15e06d8
commit 2cd921b
Showing
38 changed files
with
254 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
...ples/generated/react-native/js/dictionary-test.snippet.delete-members-of-a-dictionary.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
source/examples/generated/react-native/js/dictionary-test.snippet.update-a-dictionary.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 13 additions & 6 deletions
19
...amples/generated/react-native/js/embedded-objects-test.snippet.delete-embedded-object.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 6 additions & 5 deletions
11
...xamples/generated/react-native/js/embedded-objects-test.snippet.query-embedded-object.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
source/examples/generated/react-native/js/mixed-test.snippet.query-mixed-object.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 10 additions & 9 deletions
19
source/examples/generated/react-native/js/read.test.snippet.crud-read-filter-data.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
source/examples/generated/react-native/js/relationships-test.snippet.query-backlinks.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
source/examples/generated/react-native/js/sets-test.snippet.add-items-to-set.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
source/examples/generated/react-native/js/sets-test.snippet.check-set-items-and-size.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
source/examples/generated/react-native/js/sets-test.snippet.remove-items-from-set.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
source/examples/generated/react-native/ts/Profile.snippet.ts-profile-schema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 12 additions & 15 deletions
27
source/examples/generated/react-native/ts/add-query-to-subs.test.snippet.add-query.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,28 @@ | ||
import React, {useEffect} from 'react'; | ||
// get realm context from createRealmContext() | ||
import {RealmContext} from '../RealmConfig'; | ||
import {Text, FlatList} from 'react-native'; | ||
|
||
const {useRealm} = RealmContext; | ||
import {useRealm, useQuery} from '@realm/react'; | ||
|
||
function SubscriptionManager() { | ||
const realm = useRealm(); | ||
const seenBirds = realm.objects('Bird').filtered('haveSeen == true'); | ||
const seenBirds = useQuery(Bird, birds => { | ||
return birds.filtered('haveSeen == true'); | ||
}); | ||
|
||
useEffect(() => { | ||
realm.subscriptions.update((mutableSubs, realm) => { | ||
// Create subscription query | ||
const seenBirdsSubQuery = realm | ||
.objects('Bird') | ||
.filtered('haveSeen == true'); | ||
realm.subscriptions.update( | ||
(mutableSubs: Realm.App.Sync.MutableSubscriptionSet) => { | ||
|
||
// Create subscription for filtered results. | ||
mutableSubs.add(seenBirdsSubQuery, {name: 'seenBirds'}); | ||
}); | ||
// Create subscription for filtered collection. | ||
mutableSubs.add(seenBirds, {name: 'seenBirds'}); | ||
}, | ||
); | ||
}); | ||
|
||
return ( | ||
<FlatList | ||
data={seenBirds} | ||
keyExtractor={bird => bird._id.toString()} | ||
renderItem={({item}) => <Text>{item._id}</Text>} | ||
keyExtractor={item => item._id.toString()} | ||
renderItem={({item}) => <Text>{item._id.toString()}</Text>} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
...ples/generated/react-native/ts/dictionary-test.snippet.delete-members-of-a-dictionary.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.