@websolutespa/bom-mixer-hooks 0.1.0 → 0.2.0
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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -217,7 +217,7 @@ type UseFiltersResultType<T> = {
|
|
|
217
217
|
itemsWithOmittedKeys: (...keys: string[]) => T[];
|
|
218
218
|
};
|
|
219
219
|
|
|
220
|
-
declare const createGenericContext: <T>() => readonly [() => NonNullable<T>, React$1.Provider<T | undefined>];
|
|
220
|
+
declare const createGenericContext: <T>(defaultContext?: T | null) => readonly [() => NonNullable<T>, React$1.Provider<T | undefined>];
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
223
|
* @desc Made compatible with {GeolocationPositionError} and {PositionError} cause
|
package/dist/index.js
CHANGED
|
@@ -196,8 +196,8 @@ function useHttpFetch(pathname, options = { method: "GET" }, service = import_bo
|
|
|
196
196
|
|
|
197
197
|
// src/useGenericContext/useGenericContext.ts
|
|
198
198
|
var import_react2 = require("react");
|
|
199
|
-
var createGenericContext = () => {
|
|
200
|
-
const genericContext = (0, import_react2.createContext)(
|
|
199
|
+
var createGenericContext = (defaultContext = null) => {
|
|
200
|
+
const genericContext = (0, import_react2.createContext)(defaultContext);
|
|
201
201
|
const useGenericContext = () => {
|
|
202
202
|
const context = (0, import_react2.useContext)(genericContext);
|
|
203
203
|
if (!context) {
|
package/dist/index.mjs
CHANGED
|
@@ -79,8 +79,8 @@ function useHttpFetch(pathname, options = { method: "GET" }, service = httpFetch
|
|
|
79
79
|
|
|
80
80
|
// src/useGenericContext/useGenericContext.ts
|
|
81
81
|
import { createContext, useContext } from "react";
|
|
82
|
-
var createGenericContext = () => {
|
|
83
|
-
const genericContext = createContext(
|
|
82
|
+
var createGenericContext = (defaultContext = null) => {
|
|
83
|
+
const genericContext = createContext(defaultContext);
|
|
84
84
|
const useGenericContext = () => {
|
|
85
85
|
const context = useContext(genericContext);
|
|
86
86
|
if (!context) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@websolutespa/bom-mixer-hooks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Mixer Hooks module of the BOM Repository",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bom",
|
|
@@ -22,12 +22,11 @@
|
|
|
22
22
|
"prepack": "bom prepack",
|
|
23
23
|
"postpack": "bom postpack"
|
|
24
24
|
},
|
|
25
|
-
"dependencies": {
|
|
25
|
+
"dependencies": {},
|
|
26
|
+
"peerDependencies": {
|
|
26
27
|
"@websolutespa/bom-core": "*",
|
|
27
28
|
"@websolutespa/bom-mixer-models": "*",
|
|
28
|
-
"@websolutespa/bom-mixer-store": "*"
|
|
29
|
-
},
|
|
30
|
-
"peerDependencies": {
|
|
29
|
+
"@websolutespa/bom-mixer-store": "*",
|
|
31
30
|
"framer-motion": ">= 7.2.1",
|
|
32
31
|
"iron-session": ">= 6.2.1",
|
|
33
32
|
"next": ">= 12.3.2",
|