loop-54
v0.0.2
Published
My deku component
Downloads
5
Maintainers
Readme
loop-54
My deku component
Install
$ npm install --save loop-54
Usage
// Import loop54 main instance and some helpers
import loop54, {connectable, components} from 'loop-54'
// Create connectable components out of "dumb components" (components without state and logic)
const Autocomplete = connectable(state => ({
onClick: state.messengers.autocomplete.onClick$.next,
query: state.autocomplete.query,
queries: state.autocomplete.queries
}), components.Autocomplete);
const Input = connectable(state => ({
onInput: state.messengers.input.onInput$.next,
value: state.request.query
}), components.Input);
// Create an instance and get the state stream/observable
// By convention, streams variable names are suffixed with an `$`
const {state$} = loop54({
debug: true,
id: '18eb1533-a1f7-4ec8-9211-a561dcf43597',
name: 'Hello World',
url: 'http://helloworld.54proxy.se/',
similarProductsQuest: 'SimilarProducts',
createEventsQuest: 'CreateEvents',
facets: [{
autocomplete: true,
parameter: 'Category',
title: 'Kategorier'
}, {
parameter: 'Manufacturer',
title: 'Märken'
}],
autoCompletePageSize: 8,
directResultsPageSize: 2,
recommendedResultsPageSize: 2,
continousScrolling: false,
instantSearch: false,
devMode: true,
cacheAutoComplete: false,
productDescriptionAttribute: 'Description',
productImageUrl: '$1',
use26Request: true,
showValues: true
});
const render = () => {
return (
<div class='Loop54-search'>
<Input state$={state$}/>
<Autocomplete state$={state$}/>
</div>
);
};
export default {render};
License
MIT © michaelbergquistsuarez