@equinor/fusion-framework-react-app 12.0.0 → 12.0.1

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 +1 @@
1
- export declare const version = "12.0.0";
1
+ export declare const version = "12.0.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-react-app",
3
- "version": "12.0.0",
3
+ "version": "12.0.1",
4
4
  "description": "",
5
5
  "main": "./dist/esm/index.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -127,11 +127,11 @@
127
127
  "@equinor/fusion-framework-app": "11.0.9",
128
128
  "@equinor/fusion-framework-module-app": "8.0.2",
129
129
  "@equinor/fusion-framework-module": "6.1.0",
130
- "@equinor/fusion-framework-module-http": "8.0.3",
131
- "@equinor/fusion-framework-react": "8.0.0",
132
130
  "@equinor/fusion-framework-module-navigation": "7.0.4",
133
131
  "@equinor/fusion-framework-react-module": "4.0.1",
134
- "@equinor/fusion-framework-react-module-http": "11.0.0"
132
+ "@equinor/fusion-framework-react": "8.0.0",
133
+ "@equinor/fusion-framework-react-module-http": "11.0.0",
134
+ "@equinor/fusion-framework-module-http": "8.0.3"
135
135
  },
136
136
  "devDependencies": {
137
137
  "@types/react": "^19.2.7",
@@ -147,10 +147,10 @@
147
147
  "@equinor/fusion-framework-module-event": "6.0.0",
148
148
  "@equinor/fusion-framework-module-feature-flag": "2.0.1",
149
149
  "@equinor/fusion-framework-module-msal": "10.0.0",
150
- "@equinor/fusion-framework-react-router": "2.2.0",
150
+ "@equinor/fusion-framework-react-module-bookmark": "6.0.0",
151
151
  "@equinor/fusion-framework-react-module-context": "7.0.1",
152
152
  "@equinor/fusion-observable": "9.1.0",
153
- "@equinor/fusion-framework-react-module-bookmark": "6.0.0"
153
+ "@equinor/fusion-framework-react-router": "2.2.0"
154
154
  },
155
155
  "peerDependencies": {
156
156
  "@types/react": "^18.0.0 || ^19.0.0",
@@ -1,8 +1,9 @@
1
+ import { useMemo } from 'react';
2
+ import { map } from 'rxjs/operators';
1
3
  import type { ConfigEnvironment } from '@equinor/fusion-framework-module-app';
2
4
  import { useCurrentApp } from '@equinor/fusion-framework-react/app';
3
5
  import {
4
6
  type ObservableStateReturnType,
5
- useObservableSelector,
6
7
  useObservableState,
7
8
  } from '@equinor/fusion-observable/react';
8
9
 
@@ -42,14 +43,16 @@ export const useAppEnvironmentVariables = <
42
43
  throw Error('Framework is missing app module');
43
44
  }
44
45
 
45
- // Get the environment configuration observable from the app module
46
- const env$ = useObservableSelector(
47
- app.getConfig(),
48
- (config) => config.environment as TEnvironmentVariables,
49
- );
46
+ const env$ = useMemo(() => {
47
+ return app.getConfig().pipe(
48
+ map((config) => {
49
+ return config.environment as TEnvironmentVariables;
50
+ }),
51
+ );
52
+ }, [app]);
50
53
 
51
54
  // Return the observable state of the environment configuration
52
55
  return useObservableState(env$, {
53
- initial: app.config?.environment,
56
+ initial: app.config?.environment || ({} as TEnvironmentVariables),
54
57
  });
55
58
  };
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '12.0.0';
2
+ export const version = '12.0.1';