react-hooks-snippets icon indicating copy to clipboard operation
react-hooks-snippets copied to clipboard

Custom settings for snippets

Open dannyxnda opened this issue 5 years ago • 5 comments

Hi, I want to use the snippets with my custom settings. For example, if I type ueh, it will automatically create return cleanUp = () => {} although I don't want it. You know, we hardly have a cleanup callback except for some special cases such as setTimeout, setInterval, .... Please tell me if you can somehow improve this situation. I do appreciate this extension. Thanks!

dannyxnda avatar Oct 28 '20 04:10 dannyxnda

Hey @dan0705 thanks for the suggestion. In order to add extension controls with json settings I'll have to rebuild the extension in Typescript to allow for json setting contributions.

I have been planning to do so but can't give you a definitive timeline since this'll be new territory for me. I'll keep this issue open so I can let you know when I get around to it!

alDuncanson avatar Oct 29 '20 14:10 alDuncanson

Hey @dan0705 thanks for the suggestion. In order to add extension controls with json settings I'll have to rebuild the extension in Typescript to allow for json setting contributions.

I have been planning to do so but can't give you a definitive timeline since this'll be new territory for me. I'll keep this issue open so I can let you know when I get around to it!

I'm looking forward to using it. Thank you!

dannyxnda avatar Nov 04 '20 06:11 dannyxnda

Maybe just a setting to disable the cleanUp = () syntax? I'm pretty sure that syntax will generate errors with most linters not just TypeScript.

rsxdalv avatar Sep 30 '21 13:09 rsxdalv

Hey thanks for the reminder @rsxdalv , I still plan on tackling this.

The project got away from me for a little while but I don't see why re-writing it in Typescript would be an issue. Once that's done, we'll have the ability to add options for different variations of hooks, semi/no-semi, etc 👍🏻

alDuncanson avatar Sep 30 '21 15:09 alDuncanson

Thank you for the snippets. Thank to your extension source, I can know the syntax and write my own snippet file for VSCode.

dannyxnda avatar Oct 19 '21 07:10 dannyxnda

I no longer have the time to add new features to this extension, feel free to open a pr if you have the time!

alDuncanson avatar Sep 15 '23 22:09 alDuncanson

I understand and I'm in the same boat. I think if someone really needs this, they could make another "ueh2" snippet without the cleanup. Personally I think with AI code completion I barely need snippets anymore.

On Sat, Sep 16, 2023, 1:16 AM Al Duncanson @.***> wrote:

Closed #15 https://github.com/alDuncanson/react-hooks-snippets/issues/15 as completed.

— Reply to this email directly, view it on GitHub https://github.com/alDuncanson/react-hooks-snippets/issues/15#event-10387879011, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTRXIYPI7SSH5XMXOVRMSLX2THVBANCNFSM4TBZN5NQ . You are receiving this because you were mentioned.Message ID: @.*** com>

rsxdalv avatar Sep 16 '23 07:09 rsxdalv