Runtime-modifiable lifecycle events
See original GitHub issueInitial discussion at https://github.com/forgojs/forgo/issues/54
Initial proposal by @spiffytech
function MyComponent() {
return (component: ComponentBuilder) => {
component.mount(() => {
const interval = setInterval(doStuff, 1_000);
component.unmount(() => clearInterval(interval));
const socket = makeWebsocket();
component.unmount(() => socket.close());
});
component.render(() => <div>Hello world</div>);
};
}
This style feels good to me. What do we get from nesting the arrow function within MyComponent?
This style starts to feel a bit like SolidJS, which might be a good direction to go. Their approach seems like a logical evolution of what major frameworks have turned into.
I like this style more than trying to add events on top of the existing monolith object API.
We might need to make some multicast and some not and eat that as a documentation issue. transformAttrs would be the same as render - no point in having two of them, you’d really want (manually?) composed functions instead.
Issue Analytics
- State:
- Created a year ago
- Comments:61 (61 by maintainers)
Top Results From Across the Web
Resource descriptors - IBM
This section describes the descriptors that are used by IBM Telco Network Cloud Manager - Orchestration.
Read more >module xdc.runtime.Log
RTSC modules and the application code generate Log_Event events by calling the Log module's functions. The Log module then passes those events to...
Read more >Lifecycle event reference - Adobe Experience Platform Mobile ...
This event represents a request to the Lifecycle extension to start or pause collecting data and is generated when the lifecycleStart and lifecyclePause...
Read more >Manual: New in Unity 2022.2
Added the runtime-modifiable Texture2D property to toggle excluding the texture from mipmap limits (only for readable Texture2Ds).
Read more >Unity 2023.1.0a23
Editor: Added: Added callbacks to track selection changed events to ... Graphics: Added the runtime-modifiable Texture2D property to toggle ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sounds good! I’ll start looking into implementation later today.
Everything is out!