unistore icon indicating copy to clipboard operation
unistore copied to clipboard

WIP fix #171 Convert react integration to use hooks

Open lkmill opened this issue 5 years ago • 1 comments

To fix #171 and not use any UNSAFE_ methods, i converted the react integration to use hooks.

I haven't updated the tests yet, want to hear whether this is an acceptable change first.

Besides removing the warnings, this also greatly reduces the build file sizes:

Before:

Build "unistore" to .:
        620 B: react.js.gz
        531 B: react.js.br
Build "unistore" to full:
        801 B: react.js.gz
        708 B: react.js.br
        809 B: react.es.js.gz
        717 B: react.es.js.br
        861 B: react.umd.js.gz
        757 B: react.umd.js.br
Build "unistore" to .:
        466 B: react.js.gz
        393 B: react.js.br
Build "unistore" to full:
        682 B: react.js.gz
        592 B: react.js.br
        694 B: react.es.js.gz
        616 B: react.es.js.br
        741 B: react.umd.js.gz
        649 B: react.umd.js.br

With some code golf, eg not using array destructuring, it is quite simple to reduce the size further but the code becomes less readable.

lkmill avatar Apr 05 '20 20:04 lkmill

Super old PR lol 🙃

ForsakenHarmony avatar Apr 28 '22 18:04 ForsakenHarmony