Skip to content

Latest commit

 

History

History
86 lines (65 loc) · 1.21 KB

CHANGELOG.md

File metadata and controls

86 lines (65 loc) · 1.21 KB

Changelog

3.x.x

3.0.0 Bling bang bang born

2.x.x

2.0.x

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();
}, []);

1.x.x

1.2.x

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

1.1.x

timeout

If effect does not resolve before timeout error will be returned. Timeout value can be added to resolveData function.

1.0.x

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();
  },
  []
);