You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
605 B
25 lines
605 B
import * as riot from 'riot'
|
|
import Slider from './slider.riot'
|
|
|
|
riot.register('tiny-slider', Slider)
|
|
|
|
/**
|
|
* Convert object attributes constructs into strings
|
|
*
|
|
* @param {Object} attributes - style attributes as object
|
|
* @returns {string} a string with all the attributes and their values
|
|
*/
|
|
function styles(attributes) {
|
|
return Object.entries(attributes).reduce((acc, item) => {
|
|
const [key, value] = item;
|
|
return [...acc, `${key}: ${value}`];
|
|
}, []).join(';');
|
|
}
|
|
|
|
riot.install(function(component) {
|
|
component.styles = styles
|
|
return component
|
|
})
|
|
|
|
window.riot = riot
|