Skip to content

Commit

Permalink
chore: Re-export types and update release docker with build, docs ste…
Browse files Browse the repository at this point in the history
…ps (#3)
  • Loading branch information
rob-long authored Jun 10, 2024
1 parent 074fe5d commit 7bb3cbf
Show file tree
Hide file tree
Showing 32 changed files with 123 additions and 87 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ jobs:
- name: Install dependencies
run: npm install

- name: Build project
run: npm run build

- name: Generate docs
run: npm run docs

- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# @rob-long/app-bridge

**Version**: 0.0.4
**Description**: App bridge for Angular and React

## Overview
Expand All @@ -16,7 +15,7 @@ npm install @rob-long/app-bridge
## Features

- **State Management**: Utilize RxJS `BehaviorSubject` for managing state.
- **Framework Integration**: Seamless integration with Angular and React.
- **Framework Integration**: Seamless integration with Angular and React; additional framework support can be added.
- **TypeScript Support**: Fully typed with TypeScript for better developer experience.

## Usage
Expand Down
19 changes: 18 additions & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import { BehaviorSubject, Subscription } from 'rxjs';
import angular from 'angular';

/**
* Interface representing a collection of BehaviorSubject instances.
*
* @template T - The type of the values managed by the BehaviorSubjects.
*/
type SubjectEntries<T> = {
[K in SubjectKey<T>]: BehaviorSubject<T[K] | null>;
};
/**
* Interface extending the Window object to include a subject manager.
*
* @template T - The type of the values managed by the subject manager.
*/
interface WindowWithSubjectManager<T> extends Window {
_subjectManager: SubjectEntries<T>;
}
/**
* Options for configuring the AppBridge instance.
*/
Expand All @@ -14,6 +30,7 @@ interface AppBridgeOptions {
* Type alias for the keys of a given type T.
*/
type SubjectKey<T> = keyof T & string;

/**
* AppBridge class provides a bridge for state management using RxJS BehaviorSubjects.
* It manages a collection of BehaviorSubject instances, allowing for state updates,
Expand Down Expand Up @@ -164,4 +181,4 @@ declare function createAppBridgeService<T>(applicationName: string): angular.IMo
*/
declare const useAppBridge: <T>(subjectName: SubjectKey<T>) => readonly [T[SubjectKey<T>] | null, (newState: T[SubjectKey<T>]) => void];

export { createAppBridgeService as appBridgeService, createAppBridge, useAppBridge };
export { type AppBridgeOptions, type SubjectEntries, type SubjectKey, type WindowWithSubjectManager, createAppBridgeService as appBridgeService, createAppBridge, useAppBridge };
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/navigation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/assets/search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7bb3cbf

Please sign in to comment.