Skip to content

Bring the context method more inline with other Yew APIs by separating#1891

Closed
Diggsey wants to merge 1 commit into
yewstack:masterfrom
Diggsey:refactor-context
Closed

Bring the context method more inline with other Yew APIs by separating#1891
Diggsey wants to merge 1 commit into
yewstack:masterfrom
Diggsey:refactor-context

Conversation

@Diggsey
Copy link
Copy Markdown
Contributor

@Diggsey Diggsey commented May 31, 2021

registration from getting the current context value.

Description

The context() method on scopes now returns a Context<T> object. This object has separate methods to access the current context vs listen for when the context changes. The use_context hook continues to automatically do both.

The need for this split became apparant during the work on #1860 but makes sense to merge separately.

Checklist

  • I have run cargo make pr-flow
  • I have reviewed my own code
  • I have added tests

registration from getting the current context value.
@Diggsey Diggsey force-pushed the refactor-context branch from 9feb44f to dd398b3 Compare June 6, 2021 22:36
@mc1098 mc1098 added the A-yew Area: The main yew crate label Sep 20, 2021
@voidpumpkin
Copy link
Copy Markdown
Member

Looks to me in https://yew.rs/next/concepts/contexts there is an example where you can pass a callback that would trigger on changes, thus i dont think this is an an issue.
Please message me if you disagree, for now im closing the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-yew Area: The main yew crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants