kmoskwiak / useSSE

use Server-Side Effect ✨in React SSR app
https://kspr.dev/use-sse/
MIT License
138 stars 10 forks source link

Remove `key` from params. #1

Closed kmoskwiak closed 4 years ago

kmoskwiak commented 4 years ago

key param is unnecessary and may lead to problems with data overwriting in global context.

This is how useSSE should be invoked:

useSSE(
    {},
    () => { return new Promise((resolve) => {}); },
    []
  );