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

@rx-signals/store

Package Overview
Dependencies
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rx-signals/store - npm Package Compare versions

Comparing version 3.0.0-rc38 to 3.0.0-rc39

14

dist/cjs/entity-edit-signals-factory.js

@@ -11,3 +11,3 @@ "use strict";

const validated_input_with_result_signals_factory_1 = require("./validated-input-with-result-signals-factory");
const isStringRecord = (value) => value && typeof value === 'object' && !Array.isArray(value);
const isRecord = (value) => value && typeof value === 'object' && !Array.isArray(value);
/**

@@ -22,3 +22,3 @@ * A shallow equals function that performs shallow equals on records or arrays

}
if (isStringRecord(a) && isStringRecord(b)) {
if (isRecord(a) && isRecord(b)) {
return ((_a = Object.entries(a).find(([k, v]) => v !== b[k])) !== null && _a !== void 0 ? _a : null) === null;

@@ -93,3 +93,11 @@ }

load.resultPending || edit.resultPending,
load.resultPending || edit.resultPending || edit.validationPending || !edit.isValid,
load.resultPending ||
edit.resultPending ||
edit.validationPending ||
!edit.isValid ||
((0, store_utils_1.isNotNoValueType)(edit.resultInput) &&
(0, store_utils_1.isNotNoValueType)(edit.currentInput) &&
(config.entityEquals
? config.entityEquals(edit.resultInput.model, edit.currentInput.model)
: (0, exports.shallowEquals)(edit.resultInput.model, edit.currentInput.model))),
edit.currentInput === edit.validatedInput && (0, store_utils_1.isNotNoValueType)(edit.validationResult)

@@ -96,0 +104,0 @@ ? edit.validationResult

@@ -9,3 +9,3 @@ "use strict";

class SourceObservable {
constructor(sourceId, sourceObservable, lazySubscription, initialValueOrValueGetter = store_utils_1.NO_VALUE) {
constructor(sourceId, sourceObservable, lazySubscription, initialValueOrValueGetter) {
this.sourceId = sourceId;

@@ -51,5 +51,9 @@ this.sourceObservable = sourceObservable;

contextHandle.withContext(() => {
this.subscription = this.sourceObservable.subscribe(next => {
targetSubject.next(next);
}, error, complete);
this.subscription = this.sourceObservable.subscribe({
next: value => {
targetSubject.next(value);
},
error,
complete,
});
});

@@ -56,0 +60,0 @@ }

@@ -135,3 +135,3 @@ "use strict";

const sourceObservable = this.getEventStream(eventIdentifier).pipe((0, rxjs_1.withLatestFrom)(this.getBehavior(stateIdentifier)), (0, rxjs_1.map)(([event, state]) => reducer(state, event)));
this.getBehaviorControlledSubject(stateIdentifier).addSource(new source_observable_1.SourceObservable(eventIdentifier, sourceObservable, false));
this.getBehaviorControlledSubject(stateIdentifier).addSource(new source_observable_1.SourceObservable(eventIdentifier, sourceObservable, false, store_utils_1.NO_VALUE));
}

@@ -351,3 +351,3 @@ /**

const sourceId = Symbol('');
this.getEventStreamControlledSubject(eventIdentifier).addSource(new source_observable_1.SourceObservable(sourceId, observable, true));
this.getEventStreamControlledSubject(eventIdentifier).addSource(new source_observable_1.SourceObservable(sourceId, observable, true, store_utils_1.NO_VALUE));
if (this.currentLifecycleObjects !== null) {

@@ -628,3 +628,3 @@ this.currentLifecycleObjects.events.push(sourceId);

const source = sharedSource.pipe((0, rxjs_1.filter)(typedEvent => typedEvent.type === eventIdentifier), (0, rxjs_1.map)(event => event.event));
this.getEventStreamControlledSubject(eventIdentifier).addSource(new source_observable_1.SourceObservable(sourceIdentifier, source, true));
this.getEventStreamControlledSubject(eventIdentifier).addSource(new source_observable_1.SourceObservable(sourceIdentifier, source, true, store_utils_1.NO_VALUE));
}

@@ -631,0 +631,0 @@ createBehaviorControlledSubject(identifier) {

@@ -50,3 +50,4 @@ import { CombinedEffectResult, EffectOutputSignals } from './effect-signals-factory';

* the validation effect is pending, or
* edit.isValid is false (the current validation result represents invalid entity state)
* edit.isValid is false (the current validation result represents invalid entity state), or
* the result-input equals the current-input
*/

@@ -53,0 +54,0 @@ disabled: boolean;

@@ -8,3 +8,3 @@ import { combineLatest, distinctUntilChanged, map, startWith } from 'rxjs';

import { getValidatedInputWithResultSignalsFactory, } from './validated-input-with-result-signals-factory';
const isStringRecord = (value) => value && typeof value === 'object' && !Array.isArray(value);
const isRecord = (value) => value && typeof value === 'object' && !Array.isArray(value);
/**

@@ -19,3 +19,3 @@ * A shallow equals function that performs shallow equals on records or arrays

}
if (isStringRecord(a) && isStringRecord(b)) {
if (isRecord(a) && isRecord(b)) {
return ((_a = Object.entries(a).find(([k, v]) => v !== b[k])) !== null && _a !== void 0 ? _a : null) === null;

@@ -89,3 +89,11 @@ }

load.resultPending || edit.resultPending,
load.resultPending || edit.resultPending || edit.validationPending || !edit.isValid,
load.resultPending ||
edit.resultPending ||
edit.validationPending ||
!edit.isValid ||
(isNotNoValueType(edit.resultInput) &&
isNotNoValueType(edit.currentInput) &&
(config.entityEquals
? config.entityEquals(edit.resultInput.model, edit.currentInput.model)
: shallowEquals(edit.resultInput.model, edit.currentInput.model))),
edit.currentInput === edit.validatedInput && isNotNoValueType(edit.validationResult)

@@ -92,0 +100,0 @@ ? edit.validationResult

@@ -6,3 +6,3 @@ import { NO_VALUE } from './store-utils';

export class SourceObservable {
constructor(sourceId, sourceObservable, lazySubscription, initialValueOrValueGetter = NO_VALUE) {
constructor(sourceId, sourceObservable, lazySubscription, initialValueOrValueGetter) {
this.sourceId = sourceId;

@@ -48,5 +48,9 @@ this.sourceObservable = sourceObservable;

contextHandle.withContext(() => {
this.subscription = this.sourceObservable.subscribe(next => {
targetSubject.next(next);
}, error, complete);
this.subscription = this.sourceObservable.subscribe({
next: value => {
targetSubject.next(value);
},
error,
complete,
});
});

@@ -53,0 +57,0 @@ }

@@ -132,3 +132,3 @@ import { BehaviorSubject, NEVER, asyncScheduler, delay, distinctUntilChanged, filter, firstValueFrom, map, merge, of, share, switchMap, take, withLatestFrom, } from 'rxjs';

const sourceObservable = this.getEventStream(eventIdentifier).pipe(withLatestFrom(this.getBehavior(stateIdentifier)), map(([event, state]) => reducer(state, event)));
this.getBehaviorControlledSubject(stateIdentifier).addSource(new SourceObservable(eventIdentifier, sourceObservable, false));
this.getBehaviorControlledSubject(stateIdentifier).addSource(new SourceObservable(eventIdentifier, sourceObservable, false, NO_VALUE));
}

@@ -348,3 +348,3 @@ /**

const sourceId = Symbol('');
this.getEventStreamControlledSubject(eventIdentifier).addSource(new SourceObservable(sourceId, observable, true));
this.getEventStreamControlledSubject(eventIdentifier).addSource(new SourceObservable(sourceId, observable, true, NO_VALUE));
if (this.currentLifecycleObjects !== null) {

@@ -625,3 +625,3 @@ this.currentLifecycleObjects.events.push(sourceId);

const source = sharedSource.pipe(filter(typedEvent => typedEvent.type === eventIdentifier), map(event => event.event));
this.getEventStreamControlledSubject(eventIdentifier).addSource(new SourceObservable(sourceIdentifier, source, true));
this.getEventStreamControlledSubject(eventIdentifier).addSource(new SourceObservable(sourceIdentifier, source, true, NO_VALUE));
}

@@ -628,0 +628,0 @@ createBehaviorControlledSubject(identifier) {

{
"name": "@rx-signals/store",
"version": "3.0.0-rc38",
"version": "3.0.0-rc39",
"description": "Reactive state- and effects-management with behaviors and event streams",

@@ -51,4 +51,4 @@ "author": "Gerd Neudert",

"@types/jest": "^28.1.8",
"@typescript-eslint/eslint-plugin": "^5.52.0",
"@typescript-eslint/parser": "^5.52.0",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"eslint": "^8.34.0",

@@ -55,0 +55,0 @@ "eslint-config-airbnb-typescript": "^17.0.0",

@@ -6,3 +6,3 @@ # _@rx-signals/store_

:warning: This documentation is work in progress for the upcoming 3.0.0 version.
There is however NO good reason to use 2.x over 3.0.0-rc38, so please start with the rc-version (3.0.0 will be the first version I'm going to advertise publicly, so it's more like a 1.0 in reality.).
There is however NO good reason to use 2.x over 3.0.0-rc39, so please start with the rc-version (3.0.0 will be the first version I'm going to advertise publicly, so it's more like a 1.0 in reality.).
2.x is deprecated and will NOT be maintained in any way.

@@ -15,3 +15,3 @@

**`npm install --save @rx-signals/store@3.0.0-rc38`**
**`npm install --save @rx-signals/store@3.0.0-rc39`**

@@ -18,0 +18,0 @@ ## Dependencies

@@ -30,3 +30,3 @@ import { combineLatest, distinctUntilChanged, map, startWith } from 'rxjs';

const isStringRecord = (value: any): value is Record<string, any> =>
const isRecord = (value: any): value is Record<any, any> =>
value && typeof value === 'object' && !Array.isArray(value);

@@ -42,3 +42,3 @@

}
if (isStringRecord(a) && isStringRecord(b)) {
if (isRecord(a) && isRecord(b)) {
return (Object.entries(a).find(([k, v]) => v !== b[k]) ?? null) === null;

@@ -112,3 +112,4 @@ }

* the validation effect is pending, or
* edit.isValid is false (the current validation result represents invalid entity state)
* edit.isValid is false (the current validation result represents invalid entity state), or
* the result-input equals the current-input
*/

@@ -328,3 +329,11 @@ disabled: boolean;

load.resultPending || edit.resultPending,
load.resultPending || edit.resultPending || edit.validationPending || !edit.isValid,
load.resultPending ||
edit.resultPending ||
edit.validationPending ||
!edit.isValid ||
(isNotNoValueType(edit.resultInput) &&
isNotNoValueType(edit.currentInput) &&
(config.entityEquals
? config.entityEquals(edit.resultInput.model, edit.currentInput.model)
: shallowEquals(edit.resultInput.model, edit.currentInput.model))),
edit.currentInput === edit.validatedInput && isNotNoValueType(edit.validationResult)

@@ -331,0 +340,0 @@ ? edit.validationResult

@@ -19,3 +19,3 @@ import { Observable, Subject, Subscription } from 'rxjs';

private readonly lazySubscription: boolean,
private readonly initialValueOrValueGetter: T | (() => T) | NoValueType = NO_VALUE,
private readonly initialValueOrValueGetter: T | (() => T) | NoValueType,
) {}

@@ -66,9 +66,9 @@

contextHandle.withContext(() => {
this.subscription = this.sourceObservable.subscribe(
next => {
targetSubject.next(next);
this.subscription = this.sourceObservable.subscribe({
next: value => {
targetSubject.next(value);
},
error,
complete,
);
});
});

@@ -75,0 +75,0 @@ } finally {

@@ -289,3 +289,8 @@ import {

this.getBehaviorControlledSubject(stateIdentifier).addSource(
new SourceObservable<ToBehaviorIdValueType<SID>>(eventIdentifier, sourceObservable, false),
new SourceObservable<ToBehaviorIdValueType<SID>>(
eventIdentifier,
sourceObservable,
false,
NO_VALUE,
),
);

@@ -569,3 +574,3 @@ }

this.getEventStreamControlledSubject(eventIdentifier).addSource(
new SourceObservable<ToEventIdValueType<ID>>(sourceId, observable, true),
new SourceObservable<ToEventIdValueType<ID>>(sourceId, observable, true, NO_VALUE),
);

@@ -1071,3 +1076,3 @@ if (this.currentLifecycleObjects !== null) {

this.getEventStreamControlledSubject(eventIdentifier).addSource(
new SourceObservable<T>(sourceIdentifier, source, true),
new SourceObservable<T>(sourceIdentifier, source, true, NO_VALUE),
);

@@ -1074,0 +1079,0 @@ }

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