mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
* Run eslint * Avoid DRY in importing * Update recompose * Unnecessary backticks * Update comments * Move api-path into a variable * Rename queryString to params * Proper eslint-disable
24 lines
690 B
JavaScript
24 lines
690 B
JavaScript
import React from 'react';
|
|
import { compose } from 'recompose';
|
|
import 'rxjs/add/operator/filter';
|
|
import 'rxjs/add/operator/map';
|
|
import 'rxjs/add/operator/do';
|
|
import 'rxjs/add/operator/scan';
|
|
import 'rxjs/add/operator/distinctUntilChanged';
|
|
|
|
import SimpleMarker from './SimpleMarker';
|
|
|
|
import stream2Props from '../utils/stream2Props';
|
|
|
|
export const reactiveMarker = props => <SimpleMarker {...props} />;
|
|
|
|
export const reactiveMarkerHOC = compose(
|
|
stream2Props(({ id, hoveredMarkerId$ }) =>
|
|
hoveredMarkerId$
|
|
.map(hoveredMarkerId => hoveredMarkerId === id)
|
|
.distinctUntilChanged()
|
|
.map(v => ({ hovered: v })))
|
|
);
|
|
|
|
export default reactiveMarkerHOC(reactiveMarker);
|