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

feat(editor): add store prop #214

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

feat(editor): add store prop #214

wants to merge 7 commits into from

Conversation

christianhg
Copy link
Collaborator

The store is a new, experimental way of interacting with and listening to
events from the editor.

So far it's only used to send patches into the editor.

Copy link

vercel bot commented Sep 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
editor-react-compiler ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 26, 2024 11:23am
editor-sanity-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 26, 2024 11:23am
portable-text-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 26, 2024 11:23am

@vercel vercel bot temporarily deployed to Preview – editor-react-compiler September 25, 2024 13:25 Inactive
this.change$.next({type: 'loading', isLoading: true})

this.schemaTypes = getPortableTextMemberSchemaTypes(
props.schemaType.hasOwnProperty('jsonType')
? props.schemaType
: compileType(props.schemaType),
)

// If no store is provided then we just create one
this.store = props.store ?? createEditorStore()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word store here is the only thing I can think could be discussed. I prefer the API – I just don't know about the terminology.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've renamed it to editor now.

It's been deprecated for years. Time to remove it now that `patches$` is
getting deprecated as well.
The `store` is a new, experimental way of interacting with and listening to
events from the editor.

So far it's only used to send patches into the editor.
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.

2 participants