Forum Academy Marketplace Showcase Pricing Features

How to Return a Numeric Range from Plugin

What is the correct syntax to return a numeric range from a plugin?

I used a field for numeric range and used typeof properties.range and found that it is an object. However, when I return an object in instance.publishState, I get an error in the console UnexpectedError Expected a number range, but got an object.

Bubble numeric ranges are two-element arrays of numbers:

[start_num, end_num]

If your exposed state is a list of numeric ranges, that’s a one-dimensional array where each item is also 2-element array:

[[1,2], [3,4], [5,6], ... ]

3 Likes