question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Example of overriding createURL for connectMultiRange

See original GitHub issue

as default, it creates a query param like ?date_created=1485878400%3A1488297599 do we have any way to use label as query param? ?date_created=Today

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bobylitocommented, Feb 5, 2017

👍 disregard my other comment then 😄

1reaction
bobylitocommented, Feb 4, 2017

What if you could set functions that let you change the object to the form you want? Something like:

instantsearch({
  urlSync: {
    serialize: function(state) {
      var date_created = state.getNumericRefinement('date_created', '=');
      var isToday = isToday(date_created);
      return {
	date_created: isToday? 'Today' : date_created
      };
    },
    deserialize: function(urlAsObject, state) {
      if (!urlAsObject.date_created) return state;
      if (urlAsObject.date_created === 'Today') return state.addNumericRefinement('date_created', '=', today());
      else {
        return state.addNumericRefinement('date_created', '=', urlAsObject.date_created);
      }
    }
  }
});

The state being a SearchParameters which is the the representation of the state of the search.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found