https://github.com/brucearmstrong007/angular-signals-sharedworkers
Angular@next-v16 Trying out Shared Worker with Signals
https://github.com/brucearmstrong007/angular-signals-sharedworkers
angular angularv16 portals sharedworkers signals
Last synced: 11 months ago
JSON representation
Angular@next-v16 Trying out Shared Worker with Signals
- Host: GitHub
- URL: https://github.com/brucearmstrong007/angular-signals-sharedworkers
- Owner: BruceArmstrong007
- Created: 2023-03-07T13:09:54.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-08T10:49:34.000Z (almost 3 years ago)
- Last Synced: 2025-01-24T12:32:35.631Z (about 1 year ago)
- Topics: angular, angularv16, portals, sharedworkers, signals
- Language: TypeScript
- Homepage:
- Size: 211 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Angular-Signals-SharedWorkers
Angular@next-v16 Trying out Shared Worker with Signals
# Signals
# Goal :
To learn about Shared Workers (that share data between tabs and windows) and Signals that is going to be released in Angular V16
# In This Example we get tp see :
1.) Component of Angular Popping in and out of window with the help of portals \
2.) Same Application that can maintain its state across different windows with the help of ServiceWorker \
3.) Usage of signals instead of Rxjs Subjects to Maintain State in UI. \
# Takeaway :
1.) SharedWorkers are supported in main desktop browsers and can be used share data across different tabs and windows,
we can also create a common state management library that works with all frameworks and across windows as well
might need adoptor for different frameworks \
2.) signals are just dope and exciting, first step from angular to eliminate NgZone \
# Known Issues
3.) Regarding portals, when i try to create a sub window , with ComponentPortal , the styles are not applied in new window,
unless it is also manually attached with selectors \
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.0.0-next.2.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.