online-status icon indicating copy to clipboard operation
online-status copied to clipboard

Add hooks to events

Open mathdroid opened this issue 5 years ago • 8 comments

  • [x] Add hook to online event
  • [x] Add hook to offline event
  • [x] Add hook to both online and offline event
  • [x] Add documentation
  • [ ] Add typing

mathdroid avatar Oct 26 '18 10:10 mathdroid

Not sure bringing a UI library in is a good idea, I would say these hooks should remain as small as possible to allow people consuming them to decide how they want to.

ie, if I'm not using evergreen, or don't like the look of these popups .. I can't really use this hook

hanford avatar Oct 26 '18 16:10 hanford

thoughts @jamiebuilds @fouad ?

hanford avatar Oct 26 '18 16:10 hanford

Yeah I agree I added that while developing. Need opinions on showing how to use the hooks On Fri, 26 Oct 2018 at 23.41 Jack Hanford [email protected] wrote:

@hanford requested changes on this pull request.

alternatively you could create a hook and open source it under your own name with this functionality.

I would say bringing in evergreen ui might be out of scope for these hooks

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rehooks/online-status/pull/6#pullrequestreview-168907688, or mute the thread https://github.com/notifications/unsubscribe-auth/ADkzMk6cuil2h4BgTN6kFlgpbbkaqiYiks5uoztLgaJpZM4X77yV .

mathdroid avatar Oct 26 '18 16:10 mathdroid

Yeah, no need for UI, it's only going to make things more confusing

jamiebuilds avatar Oct 26 '18 17:10 jamiebuilds

Definitely no UI 😛

jamesplease avatar Oct 26 '18 17:10 jamesplease

Just re-read the messages. I think @hanford mistook me for adding a UI lib for the main bundle. I didn't, and just used the toaster from evergreen-ui in the example (yarn example). I agree if the example toaster component should be changed though. @fouad @jamiebuilds

mathdroid avatar Oct 27 '18 17:10 mathdroid

Not sure bringing a UI library in is a good idea, I would say these hooks should remain as small as possible to allow people consuming them to decide how they want to.

ie, if I'm not using evergreen, or don't like the look of these popups .. I can't really use this hook

This is giving the users more flexibility so they can pass their own hooks to the offline and online events. The evergreen toasters are just an example

mathdroid avatar Oct 27 '18 17:10 mathdroid

I've removed the ui dependency and opt for a console.log example. Would the ability to add custom callbacks to online and offline events be a good feature though? @hanford @fouad @jamiebuilds @jamesplease

mathdroid avatar Oct 27 '18 17:10 mathdroid