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.

onInject, onDispose

See original GitHub issue

In retrospect, these 2 callback can be replaced with useEffect

   const { workspace ...
    useEffect(() => {
        // onInject    
        return () => // onDispose
    }, [workspace])

https://github.com/nbudin/react-blockly/blob/bdf8bde3cf98290e02e2d74d05a44011d1697e15/src/useBlocklyWorkspace.js#L25

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nbudincommented, May 25, 2021

Oh, gotcha - that’s a good point. In that case, yeah, I think I’m ok with removing those callbacks and instead adding that example to the documentation.

0reactions
nbudincommented, May 25, 2021

Thanks for testing!

Re discussions, I haven’t really thought about it very much. I’m a little wary of it since it seems like it would encourage people to ask questions, and as I said in the readme I haven’t really got a lot of time for this project anymore since I no longer work at a place that uses it. If I were to enable discussions on here, I think I would want to have volunteers who have agreed to help answer questions there. I’d help as much as I can, of course, I just want to set proper expectations about it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · nbudin/react-blockly - GitHub
onInject, onDispose. #52 opened on May 24, 2021 by pelikhan · 6 · set Check method is not working in statement inputs when...
Read more >
Documentation: DevExtreme - JavaScript Sortable Configuration
If the item is dragged away from the UI component, the value is -1. Default Value: null. onDisposing. A function that ...
Read more >
Disposing Injected Services (or: Using Dependency Injection ...
The DI container Microsoft.Extensions.DependencyInjection disposes registered services automatically. It's just the question when the ...
Read more >
CommandCollection Class Methods - ComponentSource CDN
OnDispose, This method can be overrided from succesors in order to dispose ... OnInsert, Performs additional custom processes before inserting a new element ......
Read more >
Use client-side callbacks like "onAdd" in typescript (solved ...
In the documentation is no example for typescript: https://docs.colyseus.io/colyseus/state/schema/#onadd-instance-key I tried the following code on my ...
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