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

Enable autocompletion for core-data store across the board #42233

Closed

Conversation

adamziel
Copy link
Contributor

@adamziel adamziel commented Jul 7, 2022

🚧 Work in Progress 🚧

The goal of this PR is to have autocompletion for useSelect( coreDataStore ) across all Gutenberg packages.

Before it's merged, I'd like to simplify the core-data getEntityRecord type signatures.

I wanted to simplify these signatures to get the curry state to work as seen in: #41578

However, I just realized it wouldn't help there. The following, simplified, signature would suffer from the same currying problem as the existing signatures:

	<
		EntityRecord extends
			| ET.EntityRecord< Context >
			| Partial< ET.EntityRecord< Context > >,
		Context extends ET.Context
	>(
		state: State,
		kind: Kind,
		name: Name,
		key: GenericRecordKey,
		query?: EntityQuery< Context, false >
	):

There may be no way around the complex currying solution I proposed in #41578 :-(

cc @dmsnell

@adamziel adamziel changed the title First stab at exposing core-data store type for useSelect across the board Enable autocompletion for core-data store across the board Jul 7, 2022
@adamziel
Copy link
Contributor Author

adamziel commented Aug 23, 2022

Superseded by #43515 and the related work.

@adamziel adamziel closed this Aug 23, 2022
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