Skip to content

Releases: kmoskwiak/useSSE

v3.0.0-beta.0

05 Jul 17:15
Compare
Choose a tag to compare
v3.0.0-beta.0 Pre-release
Pre-release

Introducing React 18 support

What's Changed

New Contributors

Full Changelog: v2.0.0...v3.0.0-beta.0

2.0.1

04 Dec 09:01
Compare
Choose a tag to compare
  • [fixed] fixed examples
  • [security] updated dependencies

v2.0.0

02 Jun 19:16
Compare
Choose a tag to compare

Initial state is no longer passed to hook. It will be always set to null.

// before
const [data, error] = useSSE(
  { data: 'initial data' }
  () => {
    return fetch();
  },
  []
);
// after
const [data, error] = useSSE(() => {
  return fetch();
}, []);

v1.2.0

31 May 19:39
Compare
Choose a tag to compare

Errors are returned separately from data.

// before
const [data] = useSSE();
// if error happend data.isError was true
// now
const [data, error] = useSSE();
// error has all error details

v1.1.2

30 May 11:38
Compare
Choose a tag to compare
v1.1.2

v1.1.1

30 May 11:34
7e53083
Compare
Choose a tag to compare

Readme update

v1.1.0

29 May 07:52
cec432b
Compare
Choose a tag to compare

Added possibility to specify timeout value on server-side.

const data = await resolveData(timeout);

v1.0.0

18 May 17:27
Compare
Choose a tag to compare

This version comes with breaking changes. Versions 0.x.x are not compatible.

  • key param is no longer needed,
  • name of global variable is now customizable,
  • seperation of data an internal contexts.

Migration from 0.x.x consists in removing key param from the useSSE hook calls:

// before
const [data] = useSSE(
  {},
  "my_key",
  () => {
    return fetch();
  },
  []
);
// after
const [data] = useSSE(
  {},
  () => {
    return fetch();
  },
  []
);