You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[This is a pure GPUI question, but I thought it's still best to post it here rather than in zed.]
The cx.new(...) function takes a build_entity closure that should produce the object behind the entity. Why does it not take the object directly?
I.e., currently it works this way:
cx.new(|cx| {
// placeholder for some code to create `my_obj`
let my_obj = ...;
my_obj
});
Why not directly like this:
// placeholder for some code to create `my_obj
let my_obj = ...;
cx.new(my_obj)
I understand that the current version allows me to use the context of the entity that I'm about to create. However, why would I ever need this in the building process of my object? For subscriptions etc. I can also use the context after creating the entity, no?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
[This is a pure GPUI question, but I thought it's still best to post it here rather than in zed.]
The
cx.new(...)function takes abuild_entityclosure that should produce the object behind the entity. Why does it not take the object directly?I.e., currently it works this way:
Why not directly like this:
I understand that the current version allows me to use the context of the entity that I'm about to create. However, why would I ever need this in the building process of my object? For subscriptions etc. I can also use the context after creating the entity, no?
Beta Was this translation helpful? Give feedback.
All reactions