react-mapbox-ui
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -12,3 +12,6 @@ import { MapboxUICtx } from "./MapboxUI"; | ||
export declare const useMapboxUI: () => MapboxUICtx; | ||
declare type MapboxUIEffectCallback = (mapCtx: Required<MapboxUICtx>) => void | (() => void); | ||
declare type NonNullCtx = { | ||
[P in keyof MapboxUICtx]: Exclude<MapboxUICtx[P], null>; | ||
}; | ||
declare type MapboxUIEffectCallback = (mapCtx: NonNullCtx) => void | (() => void); | ||
/** | ||
@@ -15,0 +18,0 @@ * useMapboxUIEffect wraps useMapboxUI in a useEffect |
{ | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"license": "MIT", | ||
@@ -15,3 +15,3 @@ "main": "dist/index.js", | ||
"start": "tsdx watch", | ||
"build": "tsdx build && build:docs", | ||
"build": "tsdx build && yarn build:docs", | ||
"build:docs": "yarn typedoc --plugin typedoc-plugin-markdown", | ||
@@ -18,0 +18,0 @@ "test": "tsdx test --passWithNoTests", |
@@ -15,5 +15,6 @@ import { useContext, useEffect } from "react"; | ||
type MapboxUIEffectCallback = ( | ||
mapCtx: Required<MapboxUICtx> | ||
) => void | (() => void); | ||
type NonNullCtx = { | ||
[P in keyof MapboxUICtx]: Exclude<MapboxUICtx[P], null>; | ||
}; | ||
type MapboxUIEffectCallback = (mapCtx: NonNullCtx) => void | (() => void); | ||
@@ -45,5 +46,5 @@ /** | ||
if (!map || !mapbox) return; | ||
const rt = effect({ map, mapbox }); | ||
const rt = effect({ map: map, mapbox: mapbox }); | ||
return rt; | ||
}, [map, mapbox, ...deps]); | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44473
532