finos / openfin-react-hooks

A collection of React Hooks built on top of the Openfin API - from Scott Logic
Apache License 2.0
48 stars 19 forks source link

hooks for the channels api #3

Closed darrenfurr closed 5 years ago

darrenfurr commented 5 years ago

added hooks & updated demo project NOTE - prettier made some formatting changes

darrenfurr commented 5 years ago

@oriondean - do you mind reviewing this? I'd love to get this put into the project, so it is in your npm package.

darrenfurr commented 5 years ago

@oriondean - I pushed updates. I manually ran the linter & things came out clean, so let me know what I missed. Also -- here are the details on the Channels API that I received from a discussion with openfin & the reason I thought it would be valuable to add to your react hooks implementation:

we found a large number of clients were building higher-order functionality on top of it, so our `Channels` API is an implementation of one of the most-common use-cases for the IAB. in contrast, it supports:

1) single provider, multi client, point-to-point or provider-to-client broadcast
2) message receivers can return a value to the sender (basic remote-function calling)
3) promise-based connection logic, by default allows for the provider and clients to be created in any order (instead of manually listening for events to ensure connection is established)
darrenfurr commented 5 years ago

@oriondean - I pushed a few more changes. When I run npm run lint here are my results:

openfin-react-hooks on  stories/hooks_channels is 📦 v1.0.1 via ⬢ v10.16.0 took 6s 
➜ npm run lint

> openfin-react-hooks@1.0.1 lint /Users/darrenfurr/github/openfin-react-hooks
> tslint **/*.ts{,x}
nickcoleman commented 5 years ago

Hey very cool hook ... waiting on this as well. Any thoughts when it will be released?