Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 6540ebb

Browse files
author
Shammamah Hossain
committed
Use pickBy.
1 parent 01324bf commit 6540ebb

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/components/RangeSlider.react.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {Component} from 'react';
22
import PropTypes from 'prop-types';
3-
import {assoc, omit} from 'ramda';
3+
import {assoc, omit, pickBy} from 'ramda';
44
import {Range, createSliderWithTooltip} from 'rc-slider';
55

66
/**
@@ -58,14 +58,8 @@ export default class RangeSlider extends Component {
5858
tipProps = tooltip;
5959
}
6060

61-
const omittedMarks = this.props.marks
62-
? Object.keys(this.props.marks).filter(value => {
63-
return value < this.props.min || value > this.props.max;
64-
})
65-
: [];
66-
67-
const truncatedMarks = omit(
68-
omittedMarks.map(mark => parseInt(mark, 10)),
61+
const truncatedMarks = pickBy(
62+
(k, mark) => mark >= this.props.min && mark <= this.props.max,
6963
this.props.marks
7064
);
7165

0 commit comments

Comments
 (0)