question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Runtime-modifiable lifecycle events

See original GitHub issue

Initial 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:closed
  • Created a year ago
  • Comments:61 (61 by maintainers)

github_iconTop GitHub Comments

1reaction
spiffytechcommented, Apr 24, 2022

Sounds good! I’ll start looking into implementation later today.

0reactions
spiffytechcommented, Sep 10, 2022

Everything is out!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found