@equinor/subsurface-app-management 2.2.1 → 2.2.2

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.
@@ -1,3 +1,4 @@
1
1
  export type MyFeatureDto = {
2
2
  uuid: string;
3
+ active: boolean;
3
4
  };
@@ -1 +1 @@
1
- import{useMemo as e}from"react";import{useFeatureToggleContext as r}from"../providers/FeatureToggleProvider.js";function o(o){const{featureUuid:t,showIfKeyIsMissing:i=!0,showIfIsLoading:s=!1}="string"==typeof o?{featureUuid:o}:o,{features:n,isError:u,isLoading:a}=r();i||console.warn(`[FeatureToggle] Feature: ${t} will not show when the feature toggle is removed! Was this intentional?`);return{showContent:e((()=>{if(!s&&a||u)return!1;const e=n?.some((e=>e.uuid===t));return!!e||i}),[s,a,u,n,i,t])}}export{o as useFeatureToggling};
1
+ import{useMemo as e}from"react";import{useFeatureToggleContext as r}from"../providers/FeatureToggleProvider.js";function t(t){const{featureUuid:o,showIfKeyIsMissing:i=!0,showIfIsLoading:n=!1}="string"==typeof t?{featureUuid:t}:t,{features:s,isError:u,isLoading:a}=r();i||console.warn(`[FeatureToggle] Feature: ${o} will not show when the feature toggle is removed! Was this intentional?`);return{showContent:e((()=>{if(!n&&a||u)return!1;const e=s?.find((e=>e.uuid===o));return e?e.active:i}),[n,a,u,s,i,o])}}export{t as useFeatureToggling};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/subsurface-app-management",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "React Typescript components/hooks to communicate with equinor/sam",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",