Closed hiteshsondhi88 closed 7 years ago
Hi @hiteshsondhi88, I've been reviewing your commit and I have found two main problems:
With the new realm parameter, lambdas arguments are not the last parameter anymore. So you can not use lambda sintax as queryAllAsync { ... }, and you are forced to use parenthesis: queryAllAsync({ ... }). I would move realm argument to the first position for all methods, in order to avoid this.
Test fails. Method testAsyncQueryLastItemShouldReturnLastItemWhenDBIsNotEmpty() is not working anymore. This is due to realm instance is beign created in a diferent thread than where is closed (whitch is the main thread). I cant find a easy solution for that. Maybe a better approach is to use a factory class for providing your custom realm instance, as @margillus sugested in one issue. See this link to see what I mean: https://github.com/magillus/Kotlin-Realm-Extensions/pull/1/files
Hi @hiteshsondhi88, thank you so much for your contribution! I will review it soon and, if everything is ok, I will merge it into master!