Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example Projects using this Library #12

Open
jgarte opened this issue Jul 27, 2022 · 1 comment
Open

Example Projects using this Library #12

jgarte opened this issue Jul 27, 2022 · 1 comment

Comments

@jgarte
Copy link

jgarte commented Jul 27, 2022

Hi,

What are some Example Projects currently using this Library?

let me know where/if I should ask questions like this about this project in the future.

@garyb
Copy link
Member

garyb commented Jul 27, 2022

I don't think there is anything out there right now, I only recently added types and functions to this library to make it semi usable! (Previously it just had the clipboard event definition).

My one and only usage of it is essentially:

import Prelude

import Effect (Effect)
import Web.Clipboard as Clipboard
import Web.HTML as HTML
import Web.HTML.Window as Window

copy  String  Effect Unit
copy text =
  void $ Clipboard.writeText text
    =<< Clipboard.clipboard
    =<< Window.navigator
    =<< HTML.window

Reading from the clipboard would be a little more involved, but if you get totally stuck I can try and help figure it out. It would be good to have an example of both operations in the README, so it would help other people too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants