Skip to content

Query and QueryLens as type aliases of a QueryBase struct.#9

Open
ItsDoot wants to merge 1 commit intochescock:query-owned-state-simplefrom
ItsDoot:query/base
Open

Query and QueryLens as type aliases of a QueryBase struct.#9
ItsDoot wants to merge 1 commit intochescock:query-owned-state-simplefrom
ItsDoot:query/base

Conversation

@ItsDoot
Copy link
Copy Markdown

@ItsDoot ItsDoot commented Nov 22, 2025

Objective

  • Remove the sometimes-unused 'state lifetime, which removes the need for the PhantomData field.

Solution

  • Rename the Query struct to QueryBase and add Query as a type alias of QueryBase (note this is a shallow rename, not a deep one).
  • Change QueryLens into a type alias of QueryBase.

I like this version for being more explicit about "am I implementing something for just Query or for both it and QueryLens?" The small downside is that type hints will probably show Query vars/params as QueryBase.

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