@eac-arch/infrastructure-state
v1.0.6
Published
Angular state helper library focused on URL query-param synchronization.
Readme
@eac-arch/infrastructure-state
Angular state helper library focused on URL query-param synchronization.
Purpose
@eac-arch/infrastructure-state currently exposes ListQueryParamsSyncer, a utility designed for list/search pages to keep query state synchronized between:
- Angular signals
- URL query parameters
- sessionStorage snapshots
Main Capabilities
- schema-driven query param model (
string,number,sortdescriptors) - typed writable signals per query key
- optional debounced signal projection for expensive reloads
- seed priority:
URL -> sessionStorage -> schema defaults - bidirectional numeric transforms (
toSignal/fromSignal) - automatic URL updates with
replaceUrl: true
Public API
export * from './lib/list-query-params/list-query-params.syncer';Usage
const syncer = new ListQueryParamsSyncer({
q: { type: 'string', debounce: 300 },
page: { type: 'number', default: 1 },
sort: { type: 'sort' },
});
syncer.params.q.set('asimov');
syncer.params.page.set(2);Dependencies
- Angular core/router + rxjs interop
rxjstslib
No direct dependency on other @eac-arch/* packages.
Development
From eac-arch-infrastructure-state:
npm install
npm run build
npm testCreated By
Erick Arostegui Cunza
Enterprise Solutions Architect
Professional Profile:
- LinkedIn: https://www.linkedin.com/in/erick-arostegui-cunza/
Articles:
- Medium: https://medium.com/@scorpius86
Channels and Media:
- Facebook: https://www.facebook.com/Erick.Arostegui.Cunza
- TikTok: https://www.tiktok.com/@erick_arostegui_cunza
- Instagram: https://www.instagram.com/erickarosteguicunza/
- Spotify: https://open.spotify.com/show/2JQxlxcRg7k7cJ1hB52Ge5
Created by Erick Arostegui Cunza.
