@nosto/search-js
    Preparing search index...

    Function useDecoratedSearchResults

    • Applies decorator types to provided products. If value is not provided, returns the latest search results from the store instead.

      Type Parameters

      Returns DecoratedResult<T>

      import { useDecoratedSearchResults } from '@nosto/search-js/preact/hooks'
      import { priceDecorator } from '@nosto/search-js/currencies'

      export default () => {
      const results = useDecoratedSearchResults<[typeof priceDecorator]>()

      return (
      <div>
      List price is {results[0].listPriceText}
      </div>
      )
      }
    • Applies decorator types to provided products. If value is not provided, returns the latest search results from the store instead.

      Type Parameters

      Parameters

      • product: SearchProduct

      Returns DecoratedProduct<T>

      import { useDecoratedSearchResults } from '@nosto/search-js/preact/hooks'
      import { priceDecorator } from '@nosto/search-js/currencies'

      export default () => {
      const results = useDecoratedSearchResults<[typeof priceDecorator]>()

      return (
      <div>
      List price is {results[0].listPriceText}
      </div>
      )
      }
    • Applies decorator types to provided products. If value is not provided, returns the latest search results from the store instead.

      Type Parameters

      Parameters

      • products: SearchResult

      Returns DecoratedResult<T>

      import { useDecoratedSearchResults } from '@nosto/search-js/preact/hooks'
      import { priceDecorator } from '@nosto/search-js/currencies'

      export default () => {
      const results = useDecoratedSearchResults<[typeof priceDecorator]>()

      return (
      <div>
      List price is {results[0].listPriceText}
      </div>
      )
      }