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

Thunk: using selector of underlaying view #952

Open
wclr opened this issue Mar 7, 2021 · 3 comments
Open

Thunk: using selector of underlaying view #952

wclr opened this issue Mar 7, 2021 · 3 comments

Comments

@wclr
Copy link
Contributor

wclr commented Mar 7, 2021

Thunk uses currently its own selector (sel) fully disregarding and replacing the selector of passed view in the resulting node. To be consistent more often one has to duplicate into a thunk selector (which defines at least node's tag) that is used in a view function, that is just a lazy wrapper around a given view.

What if thunk didn't replace the selector of the underlying view? This could be accomplished with several tweaks:

Use thunk selector to compare nodes and not use it in the resulting view, but this does not require a selector but some kind of key, though we already have the key (actually key and selector always seemed to have a kind of overlapping intentions). So probably the selector could be just removed and the thunk key is required(?).

If now calculated view's selector is used then it could be used to compare nodes to understand if the node has to be recreated.

So maybe I missing something and the current thunk design has more important considerations underneath?

@paldepind @jvanbruegge

@jvanbruegge
Copy link
Member

I never used thunks, so i cannot really give an informed answer

@kuraga
Copy link

kuraga commented Mar 11, 2021

@wclr , what's your proposition? :) And which lines of code we have to reconsider?

@wclr
Copy link
Contributor Author

wclr commented Mar 12, 2021

Here in copyToThunk sel is not copied from a target view. And probably sameNode have to be reconsidered.

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

No branches or pull requests

3 participants