Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify get/listen method argument. #14

Merged
merged 1 commit into from
Oct 11, 2019

Conversation

sgr-ksmt
Copy link
Owner

Modified get/listen method argument.

  • Before: queryBuilder: (Query) -> Queryt
Snapshot.get(.mocks, queryBuilderBlock: {
    QueryBuilder<Mock>($0).order(\Mock.name, descending: true).generate()
}) { result in
    ...
}
  • After: prepare 2 options.
    • : queryBuildBlock: (Query) -> Query
    • : queryBuilderBlock: (QueryBuilder<Data>) -> QueryBuilder<Data> (Snapshot.Data must conform to FieldNameReferable protocol)
// Use queryBuilderBlock

Snapshot.get(.mocks, queryBuilderBlock: {
    $0.order(\Mock.name, descending: true)
}) { result in
    ...
}

// Use queryBuildBlock
Snapshot.get(.mocks, queryBuildBlock: {
    $0.order("name", descending: true)
}) { result in
    ...
}

@sgr-ksmt sgr-ksmt merged commit 2406da9 into master Oct 11, 2019
@sgr-ksmt sgr-ksmt deleted the improve_read_with_query_method branch October 11, 2019 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant