Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rx-signals/angular-provider

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rx-signals/angular-provider - npm Package Compare versions

Comparing version 3.0.0-rc11 to 3.0.0-rc12

esm2020/lib/pipes/lens.pipe.mjs

6

lib/pipes/any-lens-key.pipe.d.ts
import { PipeTransform } from '@angular/core';
import { OptionalLens } from '@rx-signals/store';
import { OptionalLens, ToLensInputType } from '@rx-signals/store';
import * as i0 from "@angular/core";
type LensFrom<L> = L extends OptionalLens<infer T, any> ? T : never;
/**

@@ -11,7 +10,6 @@ * This pipe can be used to get a new `OptionalLens<T, unknown>` from an `OptionalLens<T, P>` and a key `K`.

export declare class AnyLensKeyPipe implements PipeTransform {
transform<L extends OptionalLens<any, any>, K>(l: L, k: K): OptionalLens<LensFrom<L>, unknown>;
transform<L extends OptionalLens<any, any>, K>(l: L, k: K): OptionalLens<ToLensInputType<L>, unknown>;
static ɵfac: i0.ɵɵFactoryDeclaration<AnyLensKeyPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<AnyLensKeyPipe, "anyLensKey", true>;
}
export {};
//# sourceMappingURL=any-lens-key.pipe.d.ts.map
import { PipeTransform } from '@angular/core';
import { OptionalLens, PickReturn, ToKeys } from '@rx-signals/store';
import { OptionalLens, PickReturn, ToKeys, ToLensInputType, ToLensOutputType } from '@rx-signals/store';
import * as i0 from "@angular/core";
type LensFrom<L> = L extends OptionalLens<infer T, any> ? T : never;
type LensTo<L> = L extends OptionalLens<any, infer T> ? T : never;
/**
* This pipe can be used to get a new `OptionalLens<T, P[K]>` from an `OptionalLens<T, P>` and a key `K`.
* E.g., if you have a value of type `T = number | { a: string | { b: boolean } }` and you have a lens
* of type `OptionalLens<T, T>` (from `getLens<T>()`),
* you could use `lens | lensKey:'a' | lensKey:'b' | lensGet:value` to get a result of type `boolean | undefined`.
* E.g., if you have a `value` of type `T = number | { a: string | { b: boolean } }` and you have
* a lens `myLens: OptionalLens<T, boolean> = getLens<T>().k('a).k('b)`,
* you could use `myLens | lensKey:'a' | lensKey:'b' | lens:value` to get a result of type `boolean | undefined`.
* If your IDE complains about "Type argument cannot be inferred from usage", the reason is, that it infers `'a'` as type `string`

@@ -15,12 +13,11 @@ * and not as type `'a'`.

* As long as this is not the case, you have two options:
* (a) you create a lens `readonly lens = getLens<T>().k('a').k('b')` and use `lens | lensGet:value`,
* or (c) you can use the anyLensKey pipe (that accepts any key) like `lens | anyLensKey:'a' | anyLensKey:'b' | lensGet:value`, though the latter will return unknown | undefined,
* while the first option will return the correct type.
* (a) you create a lens `readonly myLens = getLens<T>().k('a').k('b')` and use either `myLens | lens:value`, or `value | lens:myLens`
* or (c) you can use the anyLensKey pipe (that accepts any key) like `myLens | anyLensKey:'a' | anyLensKey:'b' | lens:value`, though the latter will return unknown | undefined,
* while the first to options will return the correct type (boolean | undefined).
*/
export declare class LensKeyPipe implements PipeTransform {
transform<L extends OptionalLens<any, any>, K extends ToKeys<LensTo<L>>>(l: L, k: K): OptionalLens<LensFrom<L>, PickReturn<LensTo<L>, K>>;
transform<L extends OptionalLens<any, any>, K extends ToKeys<ToLensOutputType<L>>>(l: L, k: K): OptionalLens<ToLensInputType<L>, PickReturn<ToLensOutputType<L>, K>>;
static ɵfac: i0.ɵɵFactoryDeclaration<LensKeyPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<LensKeyPipe, "lensKey", true>;
}
export {};
//# sourceMappingURL=lens-key.pipe.d.ts.map

@@ -12,5 +12,7 @@ import { PipeTransform } from '@angular/core';

* As long as this is not the case, you have three options: (a) you could create a `readonly aKey: 'a' = 'a'` and use `pick:aKey`,
* or (b) you create a lens `readonly lens = getLens<T>().k('a').k('b')` and use `lens | lensGet:value`,
* or (c) you can use the anyLensKey pipe (that accepts any key) like `lens | anyLensKey:'a' | anyLensKey:'b' | lensGet:value`, though the latter will return unknown | undefined,
* while the first to options will return the correct type.
* or (b) you create a lens `readonly myLens = getLens<T>().k('a').k('b')` and use either `myLens | lens:value`, or `value | lens:myLens`
* or (c) you can use the anyLensKey pipe (that accepts any key) like `myLens | anyLensKey:'a' | anyLensKey:'b' | lens:value`, though the latter will return unknown | undefined,
* while the first to options will return the correct type (boolean | undefined).
*
* @deprecated use LensPipe instead
*/

@@ -17,0 +19,0 @@ export declare class PickPipe implements PipeTransform {

{
"name": "@rx-signals/angular-provider",
"version": "3.0.0-rc11",
"version": "3.0.0-rc12",
"description": "Angular provider for @rx-signals/store",

@@ -29,3 +29,3 @@ "author": "Gerd Neudert",

"@angular/core": ">=14.0.0",
"@rx-signals/store": ">=3.0.0-rc42"
"@rx-signals/store": ">=3.0.0-rc43"
},

@@ -32,0 +32,0 @@ "dependencies": {

@@ -6,4 +6,4 @@ export * from './lib/rx-signals-store.module';

export * from './lib/pipes/lens-key.pipe';
export * from './lib/pipes/lens-get.pipe';
export * from './lib/pipes/lens.pipe';
export * from './lib/directives/rxs-validation.directive';
//# sourceMappingURL=public-api.d.ts.map

@@ -5,5 +5,9 @@ # @rx-signals/angular-provider

It features Angular providers for rx-signals store and/or child-stores.
In addition, it features some pipes and directives to work with validation and optional-lenses.
## Installation
**`npm install --save @rx-signals/angular-provider@3.0.0-rc11`**
**`npm install --save @rx-signals/angular-provider@3.0.0-rc12`**

@@ -10,0 +14,0 @@ If you have not yet installed the _rx-signals_ store, please see [@rx-signals/store](https://github.com/gneu77/rx-signals#installation) documentation on how to install the latest 3.x version of that peer-dependency.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc