Skip to content

Commit

Permalink
fix: rename useCartoLayerFilterProps hook to useCartoLayerProps
Browse files Browse the repository at this point in the history
  • Loading branch information
AdriSolid committed Mar 10, 2021
1 parent cf2d821 commit f8fd801
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { DataFilterExtension } from '@deck.gl/extensions';
import { renderHook } from '@testing-library/react-hooks';
import useCartoLayerFilterProps from '../../src/hooks/useCartoLayerFilterProps';
import useCartoLayerProps from '../../src/hooks/useCartoLayerProps';
import { mockClear, mockReduxHooks } from '../mockReduxHooks';

describe('useCartoLayerFilterProps', () => {
describe('useCartoLayerProps', () => {
mockReduxHooks();

const { result } = renderHook(() => useCartoLayerFilterProps());
const { result } = renderHook(() => useCartoLayerProps());

it('should return correct filter props', () => {
expect(Object.keys(result.current)).toEqual([
Expand Down
2 changes: 1 addition & 1 deletion packages/react-api/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Returns a number (0-1) or a boolean checking wether a feature should be rendered
| filters | <code>Object</code> | {} | Filters to be applied |
| type | <code>string</code> | 'boolean' | Output type: number (0-1) or boolean |

## useCartoLayerFilterProps ⇒ <code>Object</code>
## useCartoLayerProps ⇒ <code>Object</code>

Returns required default props for layers. It manages filtering and viewport changes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DataFilterExtension } from '@deck.gl/extensions';
import { debounce, _buildFeatureFilter } from '@carto/react-core';
import useViewportFeatures from './useViewportFeatures';

export default function useCartoLayerFilterProps(
export default function useCartoLayerProps(
source,
uniqueIdProperty = 'cartodb_id'
) {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-api/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { executeSQL } from './api/SQL';
export { SourceTypes } from './api/SourceTypes';

export { default as useCartoLayerFilterProps } from './hooks/useCartoLayerFilterProps';
export { default as useCartoLayerProps } from './hooks/useCartoLayerProps';

0 comments on commit f8fd801

Please sign in to comment.