Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 867 Bytes

README.md

File metadata and controls

39 lines (29 loc) · 867 Bytes

@atomico/storybook

Allows projects to render projects with virtualDOM

Setup

create .storybook/preview file and add the following script.

import { decorator } from "@atomico/storybook";

export const decorators = [decorator];

how to disable hmr? (Optional)

Create the file .storybook/disable-hmr.js and add the following script.

if (module && module.hot && module.hot.decline) {
    console.log(module);
    module.hot.decline();
    const hmr = new EventSource("__webpack_hmr");
    hmr.addEventListener("message", function fullPageReload(event) {
        try {
            const { action } = JSON.parse(event.data);
            if (action === "built") {
                location.reload();
            }
        } catch (error) {}
    });
}

render compatibility

  • atomico
  • @atomico/lit-html
  • @atomico/uhtml