An open API service indexing awesome lists of open source software.

https://github.com/bahrus/repetir


https://github.com/bahrus/repetir

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

        

# re-petir

re-petir provides a repeating web component. It extends [i-bid](https://github.com/bahrus/ib-id). Whereas i-bid has [no support for light children](https://github.com/bahrus/ib-id#what-if-i-want-to-repeat-some-web-components-that-require-non-shadow-light-children), re-peter does. It uses github's [template parts library](https://github.com/github/template-parts/) to populate the light children.

## Sample syntax

```html

{{msg}}


  • header


  • footer

{
"imports":{
"xtal-element/": "../node_modules/xtal-element/",
"trans-render/": "../node_modules/trans-render/",
"ib-id/": "../node_modules/ib-id/",
"@github/": "../node_modules/@github/"
}
}

import 're-petir/re-petir.js';

repetir.list = [
{msg: 'hello 1'},
{msg: 'hello 2'},
{msg: 'hello 3'},
{msg: 'hello 4'}
];
setTimeout(() => {
repetir.list = [
{msg: 'hello 3'},
{msg: 'hello 4'}
];
setTimeout(() => {
repetir.list = [
{msg: 'hello 1'},
{msg: 'hello 2'},
{msg: 'hello 3'},
{msg: 'hello 4'}
];
}, 10000)
}, 10000);

```

## Viewing the component locally

1. Install git
2. Clone or fork repo https://github.com/bahrus/repetir
3. Install node
4. Open command window from cloned location of step 2.
5. Run command "npm run install"
6. Run command "npm run serve"
7. Open browser to http://localhost:3030/demo/dev