https://github.com/algoristic/tinyparams-async
Rxjs wrapper for @algoristic/tinyparams
https://github.com/algoristic/tinyparams-async
async location parameters query rxjs search url
Last synced: about 1 month ago
JSON representation
Rxjs wrapper for @algoristic/tinyparams
- Host: GitHub
- URL: https://github.com/algoristic/tinyparams-async
- Owner: algoristic
- Created: 2025-04-02T05:56:47.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-04-02T06:27:56.000Z (about 2 months ago)
- Last Synced: 2025-04-13T12:57:49.714Z (about 1 month ago)
- Topics: async, location, parameters, query, rxjs, search, url
- Language: TypeScript
- Homepage:
- Size: 54.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @algoristic/tinyparams-async
> [`rxjs`](https://www.npmjs.com/package/rxjs) wrapper for [`@algoristic/tinyparams`](https://www.npmjs.com/package/@algoristic/tinyparams).
## Installation
```sh
npm i @algoristic/tinyparams-async
```## Usage
```ts
import { params } from '@algoristic/tinyparams-async';
```### Observe single params
```ts
params('foo')
.observe()
.subscribe((value) => {
console.log(`foo=${foo}`);
});params('foo')
.observe()
.pipe(pairwise(), startWith(undefined))
.subscribe(([prev, curr]) => {
console.log(`previous=${prev}, current=${curr}`);
});
```#### Observe all params
```ts
params.observe().subscribe((snapshot) => {
console.log(snapshot.entries());
});
```