electron-plugin
electron-plugin copied to clipboard
Add Clipboard events
This PR should add an abilty to fire Clipboard events. If this PR seems reasonable to you please leave a comment and I will create PR for NativePHP Laravel Repo to handle these events. Thanks.
How do you intend to use this? Can you explain what you're doing/trying to do?
Also, I'm not sure what the name proceedToNotification is meant to imply... it seems ambiguous to me. Can we come up with a better name?
I was trying to build a clipboard manager. The idea was to listen for clipboard events on Livewire component so I can create a new DB record. Earlier I thought about wire:poll to check if clipboard has value, but it's not a good idea.
Could not agree more on naming... But I would think about a better one or might you suggest an option. Surely if you think it's something worth adding.
@simonhamp I made changes according to our chat. However I keep enum names plural to be consistent. Let me know if you have any other suggestions. Thanks.
I've looked through this with a fresh pair of eyes and I have more concerns...
These clipboard endpoints are used by the Laravel side of the application to read from and write to the clipboard... so in theory, if you're just trying to get event data over into Livewire, you should just be able to fire a custom event from your application that Livewire should pick it up via the native: callsign.
That would prevent this possible infinite loop that I think this implementation could more easily create.
@kirilldakhniuk I'm going to close this for now, as I can't quite fathom how this PR is going to give you what you're after.
I did a bit of digging, and I think what you need isn't available in Electron.
You could implement something like a polling mechanism (e.g. a Scheduled Task in Laravel which checked the clipboard on a regular basis), but I think this is not very performant and would be quite a nasty solution imo.
Sorry for the run-around.
@simonhamp got it. I thought about pulling using a command and felt the same unpleasant feeling about it. Thank you.