@equinor/fusion-framework-react-module-signalr 4.0.0 → 4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @equinor/fusion-framework-module-signalr@12.0.0
8
+
3
9
  ## 4.0.0
4
10
 
5
11
  ### Major Changes
package/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # @equinor/fusion-framework-react-module-signalr
2
+
3
+ React hooks for the Fusion SignalR module. Subscribe to real-time SignalR hub topics from React components with automatic connection management.
4
+
5
+ **Import:**
6
+
7
+ ```ts
8
+ import { useTopic, enableSignalR } from '@equinor/fusion-framework-react-module-signalr';
9
+ ```
10
+
11
+ ## Exports
12
+
13
+ | Export | Type | Description |
14
+ | --------------------- | -------- | --------------------------------------------------------- |
15
+ | `useTopic` | Hook | Subscribe to a SignalR topic using the closest module scope |
16
+ | `useProviderTopic` | Hook | Subscribe to a SignalR topic with an explicit provider |
17
+ | `enableSignalR` | Function | Enable the SignalR module in a configurator |
18
+ | `Topic` | Class | A SignalR topic instance for pub/sub messaging |
19
+ | `ISignalRConfigurator`| Type | Configurator interface |
20
+ | `SignalRHubConfig` | Type | Hub connection configuration |
21
+ | `SignalRModule` | Type | Module type definition |
22
+
23
+ ## useTopic
24
+
25
+ Subscribe to a SignalR hub topic. Returns a `Topic<T>` instance that exposes an observable message stream.
26
+
27
+ ```tsx
28
+ import { useTopic } from '@equinor/fusion-framework-react-module-signalr';
29
+
30
+ type NotificationPayload = { message: string; severity: 'info' | 'warning' };
31
+
32
+ const Notifications = () => {
33
+ const topic = useTopic<NotificationPayload>('notifications-hub', 'alerts');
34
+
35
+ // topic.message$ is an Observable<NotificationPayload>
36
+ // topic.send(payload) publishes to the hub
37
+
38
+ return <div>Listening for alerts…</div>;
39
+ };
40
+ ```
41
+
42
+ ## useProviderTopic
43
+
44
+ Same as `useTopic`, but accepts an explicit `ISignalRProvider` instead of resolving from the module scope. Use this in libraries or when multiple providers are available.
45
+
46
+ ```ts
47
+ import { useProviderTopic } from '@equinor/fusion-framework-react-module-signalr';
48
+ import type { ISignalRProvider } from '@equinor/fusion-framework-module-signalr';
49
+
50
+ declare const provider: ISignalRProvider;
51
+
52
+ const topic = useProviderTopic<MyPayload>(provider, 'hub-id', 'topic-id');
53
+ ```
54
+
55
+ ## Related
56
+
57
+ - [`@equinor/fusion-framework-module-signalr`](../../../modules/signalr/README.md) — the underlying SignalR module
package/dist/esm/index.js CHANGED
@@ -1,3 +1,14 @@
1
+ /**
2
+ * React integration for the Fusion SignalR module.
3
+ *
4
+ * Provides hooks for subscribing to SignalR hub topics from React components.
5
+ * Use {@link useTopic} for module-scoped access or {@link useProviderTopic}
6
+ * when injecting a provider explicitly.
7
+ *
8
+ * @see {@link enableSignalR} to enable the module in a configurator.
9
+ *
10
+ * @packageDocumentation
11
+ */
1
12
  export { useSignalRProvider as useProviderTopic } from './use-signalr-provider';
2
13
  export { useTopic } from './use-signalr';
3
14
  export { Topic, enableSignalR } from '@equinor/fusion-framework-module-signalr';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,kBAAkB,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '4.0.0';
2
+ export const version = '4.0.1';
3
3
  //# sourceMappingURL=version.js.map