File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change
1
+ <img src =" https://github.com/QueryKit/QueryKit/blob/master/QueryKit.png " width =96 height =120 alt =" QueryKit Logo " />
2
+
1
3
# RxQueryKit
2
4
3
5
[ RxSwift] ( https://github.com/ReactiveX/RxSwift ) extensions for QueryKit.
@@ -10,15 +12,21 @@ RxQueryKit extends QueryKit and provides methods to evaluate and execute
10
12
operations as observables.
11
13
12
14
``` swift
13
- let queryset = Person.queryset (context).filter (Person.age > 25 )
15
+ let queryset = Person.queryset (context)
16
+ .filter { $0 .age > 25 }
17
+ .orderBy { $0 .name .ascending }
14
18
```
15
19
20
+ You can subscribe to any changes to the results of this queryset using the following:
21
+
16
22
``` swift
17
23
queryset.objects ().subscribeNext {
18
24
print ($0 )
19
25
}
20
26
```
21
27
28
+ You can also subscribe to the number of matching objects:
29
+
22
30
``` swift
23
31
queryset.count ().subscribeNext {
24
32
print (" There are now \( $0 ) people who are more than 25." )
@@ -30,6 +38,8 @@ queryset.count().subscribeNext {
30
38
RxQueryKit provides extensions on managed object context to observe when the
31
39
objects in a context change or when a context will or did save.
32
40
41
+ It provides a type safe structure providing the changes objects.
42
+
33
43
``` swift
34
44
context.qk_objectsDidChange ().subscribeNext { notification in
35
45
print ('Objects did change: ')
@@ -57,4 +67,4 @@ pod 'RxQueryKit'
57
67
58
68
## License
59
69
60
-
70
+ QueryKit is released under the BSD license. See [ LICENSE ] ( LICENSE ) .
You can’t perform that action at this time.
0 commit comments