How to use the haunted.component function in haunted

To help you get started, we’ve selected a few haunted examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kjartanm / microfrontends / packages / login / src / index.js View on Github external
<h3>Log in or register an account!</h3>
                    
                    

                     update({customerid: '45645645'})}&gt;Log in
                    Register
                            
                `
            :html`<h2>(You are already logged in, go to the <a href="/pizzamenu">pizza menu</a> and order some pizzas :)</h2>`

        }
        
    `;
}
customElements.define('x-login', component(LoginFE, { useShadowDOM: false }));
github geocine / web-components-hooks-demo / src / context / shop-context.js View on Github external
const createConsumer = Context =>
  component(
    function({ render }) {
      const context = useContext(Context);

      return render(context);
    },
    HTMLElement,
    { useShadowDOM: false }
  );
github geocine / web-components-hooks-demo / src / context / GlobalState.js View on Github external
`;
};

export default GlobalState;

customElements.define("global-state", component(GlobalState));
github geocine / web-components-hooks-demo / src / components / MainNavigation.js View on Github external
Products
          
          <li>
            Cart (${cartItemNumber})
          </li>
        
      
    
  `;
};

export default MainNavigation;

customElements.define(
  "main-navigation",
  component(MainNavigation, HTMLElement, { useShadowDOM: false })
);
github geocine / web-components-hooks-demo / src / router.js View on Github external
.on(route.path, params => {
          if (!customElements.get(route.tag)) {
            customElements.define(
              route.tag,
              component(route.page, HTMLElement, { useShadowDOM: false })
            );
          }
          Router.inject(route.tag);
        })
        .resolve();
github open-wc / open-wc / packages / create / src / generators / app-haunted / templates / static / components / page-main / src / PageMain.js View on Github external
${logo}
    <h1>${title}</h1>
    <p>Edit <code>src/MyApp.js</code> and save to reload.</p>
    <a rel="noopener noreferrer" href="https://open-wc.org/developing/#examples" class="app-link">
      Code examples
    </a>
  `;
}

export const PageMain = component(PageMainElement);
github geocine / web-components-hooks-demo / src / components / RouterLink.js View on Github external
color: var(--color-active, black);
      }
    
    <a class="${active ?" href="${element.to}">
      
    </a>
  `;
};

RouterLink.observedAttributes = ["to"];

customElements.define("router-link", component(RouterLink));

haunted

Hooks for web components

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis