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

Rename EmitterBuilder.mapResult -> mapModifier ? #646

Open
fdietze opened this issue Sep 14, 2022 · 9 comments
Open

Rename EmitterBuilder.mapResult -> mapModifier ? #646

fdietze opened this issue Sep 14, 2022 · 9 comments

Comments

@fdietze
Copy link
Member

fdietze commented Sep 14, 2022

@inline def mapResult[S](f: R => S): EmitterBuilderExecution[O, S, Exec] =

@cornerman
Copy link
Member

In understand it, but currently an emitterbuilder could also return a VNode or something totally different. mapModifier would not capture that. Is there a better name that leaves that open?

@fdietze
Copy link
Member Author

fdietze commented Sep 14, 2022

what else can it return that is not a VModifier?

@cornerman
Copy link
Member

Everything, that can own a subscription :)

@fdietze
Copy link
Member Author

fdietze commented Sep 14, 2022

Sounds a bit too generic to me. Is there a good use-case?

@cornerman
Copy link
Member

One example, the typeclass allows us to return any Functor, like an Option, a List or IO of a Modifier as a result. Furthermore, you could also return something totally different like an Observable[Something], because they can also own a subscription. I had a use-case once - though not very common.

@cornerman
Copy link
Member

I guess, it is debatable whether we need to support that - but I did not see a reason why not. We anyhow need to keep it generic to have a distinction between VNode and VModifier.

@cornerman
Copy link
Member

Do we have a better name than mapResult that stays generic?

@fdietze
Copy link
Member Author

fdietze commented Oct 25, 2022

mapContainer, mapOwner, something like that? Result is misleading imho.

@cornerman
Copy link
Member

Hmm, though Owner is already used for reactive ownership, not sure whether we should mix this here. Container is interesting, but also not really intuitive to me.

I thought, result was good, because it is a builder and that typically has a result (what you get when you assign an observer with --> or foreach). The idea was to reuse that vocabulary.

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

2 participants