{"repo":"fernandopasik/lit-redux-router","free":true,"listed":false,"github":"https://github.com/fernandopasik/lit-redux-router","clone":"git clone https://github.com/fernandopasik/lit-redux-router.git","description":"Declarative way of routing for lit-html powered by pwa-helpers, redux and lit-element","language":"TypeScript","stars":124,"topics":["web-component","web-components-library","lit","lit-element","lit-elements","router","routing","web-components","redux"],"license":"MIT","category":"ui-components","readme_excerpt":"Lit Redux Router Declarative way of routing for lit powered by pwa-helpers and redux. A minimal router solution ( 1.7 kb Gzipped) that consist in using lit-route elements and connecting them to the store. The routing approach is based on the PWA Starter Kit. Install Install this library and its peer dependencies Usage Firstly ensure that the redux store has been created with the lazyReducerEnhancer , which allows for reducers to be installed lazily after initial store setup. Then the router needs to connect to a redux store . lit-route component can render the components when the path attribute matches. The corresponding active lit-route element will reflect the active attribute . Ideally all content would be in a component and can be passed to lit-route through a component attribute . lit-route can map path variables and inject them in the provided component. When no path attribute is provided to lit-route , it will render when no route matches (404) To trigger navigation without using a link element, the action navigate can be imported and triggered with the wanted path To lazy load a component on route change and optionally show a loading component while waiting for the import to resolve The window will scroll to top by default, to disable add the attribute scrollDisable To scroll to the route element on load, you can set the scrollIntoViewOptions object in the attribute .scrollOpt Check a more comprehensive example in https://github.com/fernandopasik/lit-redux-router/blob","default_branch":null,"files":null,"tree":[],"storefront":"/r/fernandopasik","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/fernandopasik/lit-redux-router/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}