Git Product home page Git Product logo

Comments (4)

sindresorhus avatar sindresorhus commented on June 25, 2024

I agree with the problem, do you have any suggestions on how we could solve this?

from electron-context-menu.

jarivo avatar jarivo commented on June 25, 2024

With the solution defined in #14, I think a simple callback won't be possible with the "enums".

I will try and start implementing #14 (in the coming days) and maybe things will become clearer down the road.

from electron-context-menu.

sindresorhus avatar sindresorhus commented on June 25, 2024

@jarivo Sure, it could. We could make x.COPY => x.COPY({transform: url => url.replace()}), but not sure it's the best solution. Maybe we could have a hook option function that receives every action and is able to modify it or something.

I will try and start implementing #14 (in the coming days)

🤗

from electron-context-menu.

jarivo avatar jarivo commented on June 25, 2024

I personally prefer your first suggestion, it is clean and "future-proof" for extra options which might be action-specific. If they want a general hook function, they can by adding it as a transform for each of them.

The second suggestion is less work on our side, but I think it would become messy when someone needs to implement custom behaviour for all of them. Sure it is much easier when you want to manipulate all incoming text/urls/strings (e.g. replacing http with https)

So I think both of them have some use cases, but the first one seems less of a hurdle for the end user.

from electron-context-menu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.