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+
13# RxQueryKit
24
35[ RxSwift] ( https://github.com/ReactiveX/RxSwift ) extensions for QueryKit.
@@ -10,15 +12,21 @@ RxQueryKit extends QueryKit and provides methods to evaluate and execute
1012operations as observables.
1113
1214``` 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 }
1418```
1519
20+ You can subscribe to any changes to the results of this queryset using the following:
21+
1622``` swift
1723queryset.objects ().subscribeNext {
1824 print ($0 )
1925}
2026```
2127
28+ You can also subscribe to the number of matching objects:
29+
2230``` swift
2331queryset.count ().subscribeNext {
2432 print (" There are now \( $0 ) people who are more than 25." )
@@ -30,6 +38,8 @@ queryset.count().subscribeNext {
3038RxQueryKit provides extensions on managed object context to observe when the
3139objects in a context change or when a context will or did save.
3240
41+ It provides a type safe structure providing the changes objects.
42+
3343``` swift
3444context.qk_objectsDidChange ().subscribeNext { notification in
3545 print ('Objects did change: ')
@@ -57,4 +67,4 @@ pod 'RxQueryKit'
5767
5868## License
5969
60-
70+ QueryKit is released under the BSD license. See [ LICENSE ] ( LICENSE ) .
You can’t perform that action at this time.
0 commit comments