@trackunit/react-core-hooks 0.2.223-alpha-213b74a9d8d.0 → 0.2.223

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -34,7 +34,7 @@ const AnalyticsContextProvider = AnalyticsContext.Provider; // easy import
34
34
  *
35
35
  * @example
36
36
  * import { useAnalytics, useEnvironment } from "@trackunit/react-core-hooks";
37
- * const { logPageView, logEvent } = useAnalytics(AllEvents);
37
+ * const { logPageView, logEvent } = useAnalytics(SharedEvents);
38
38
  *
39
39
  * // log page view event
40
40
  * useEffect(() => {
@@ -45,7 +45,7 @@ const AnalyticsContextProvider = AnalyticsContext.Provider; // easy import
45
45
  * logEvent("Login", { loginPage: "New Manager" });
46
46
  * @see {@link IAnalyticsContext}
47
47
  */
48
- const useAnalytics = (type) => {
48
+ const useAnalytics = (events) => {
49
49
  const context = React.useContext(AnalyticsContext);
50
50
  if (!context) {
51
51
  throw new Error("useAnalytics must be used within an AnalyticsProvider");
package/index.esm.js CHANGED
@@ -11,7 +11,7 @@ const AnalyticsContextProvider = AnalyticsContext.Provider; // easy import
11
11
  *
12
12
  * @example
13
13
  * import { useAnalytics, useEnvironment } from "@trackunit/react-core-hooks";
14
- * const { logPageView, logEvent } = useAnalytics(AllEvents);
14
+ * const { logPageView, logEvent } = useAnalytics(SharedEvents);
15
15
  *
16
16
  * // log page view event
17
17
  * useEffect(() => {
@@ -22,7 +22,7 @@ const AnalyticsContextProvider = AnalyticsContext.Provider; // easy import
22
22
  * logEvent("Login", { loginPage: "New Manager" });
23
23
  * @see {@link IAnalyticsContext}
24
24
  */
25
- const useAnalytics = (type) => {
25
+ const useAnalytics = (events) => {
26
26
  const context = useContext(AnalyticsContext);
27
27
  if (!context) {
28
28
  throw new Error("useAnalytics must be used within an AnalyticsProvider");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-core-hooks",
3
- "version": "0.2.223-alpha-213b74a9d8d.0",
3
+ "version": "0.2.223",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -7,7 +7,7 @@ export declare const AnalyticsContextProvider: import("react").Provider<IAnalyti
7
7
  *
8
8
  * @example
9
9
  * import { useAnalytics, useEnvironment } from "@trackunit/react-core-hooks";
10
- * const { logPageView, logEvent } = useAnalytics(AllEvents);
10
+ * const { logPageView, logEvent } = useAnalytics(SharedEvents);
11
11
  *
12
12
  * // log page view event
13
13
  * useEffect(() => {
@@ -18,4 +18,4 @@ export declare const AnalyticsContextProvider: import("react").Provider<IAnalyti
18
18
  * logEvent("Login", { loginPage: "New Manager" });
19
19
  * @see {@link IAnalyticsContext}
20
20
  */
21
- export declare const useAnalytics: <T extends Record<string, Event<BaseEvent | import("@trackunit/react-core-contexts-api").AdditionalProperties>> = never>(type?: T) => IAnalyticsContext<T>;
21
+ export declare const useAnalytics: <TEvents extends Record<string, Event<BaseEvent | import("@trackunit/react-core-contexts-api").AdditionalProperties>> = never>(events: TEvents) => IAnalyticsContext<TEvents>;