Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Equatable sinks prototype#254

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
watt wants to merge3 commits intotomb/swiftui-testbed
base:tomb/swiftui-testbed
Choose a base branch
Loading
fromawatt/equatable-sinks

Conversation

@watt
Copy link
Collaborator

No description provided.

}
}

// I guess this could be upstreamed to Blueprint
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah, I think I've seen this go by in POS

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm just now noticing that SwiftUI'sFocusState is not Equatable. That makes it harder forViews to be Equatable, but I presume SwiftUI's internal comparison of non-Equatable View types handles it well.

}
}

// I guess this could be upstreamed to Blueprint
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm just now noticing that SwiftUI'sFocusState is not Equatable. That makes it harder forViews to be Equatable, but I presume SwiftUI's internal comparison of non-Equatable View types handles it well.

Comment on lines -22 to +24
letclose:(()->Void)?

typealiasOutput=Never
enumOutput{
case close
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We could upstreamdeed364 to#240. Seems cleaner and more conventional than what I was doing there!

structState{
vartitle:String
varisAllCaps:Bool
lettrampoline=SinkTrampoline()
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like the best/only way to create a persistent identity that we can use to implementStableSink.== 👍

Comment on lines +97 to +101
letsink= context.makeSink(of: actionType)

sinks[ObjectIdentifier(actionType)]= sink

returnStableSink(trampoline:self)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we could passsink intoStableSink.init here and implementStableSink.send using that reference, allowing us to deletesinks,bounce, anddestination. That would also avoid retaining anyWorkflow.Sink that is no longer referenced by anyStableSink

Maintainingsinks does add some safety (againstthis, I think?) by ensuring we use the latestWorkflow.Sink that theRenderContext has given us for a givenAction type. But not total safety, because we're not evicting fromsinks every sink that wasn't remade during the lastrender.

Is the need for that safety greater when the Rendering holdsStableSinks rather than functions closing overWorkflow.Sinks?

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

Reviewers

@kylevekylevekyleve left review comments

@square-tombsquare-tombsquare-tomb left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@watt@kyleve@square-tomb

[8]ページ先頭

©2009-2025 Movatter.jp