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

@ngneat/elf-state-history

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngneat/elf-state-history - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

9

CHANGELOG.md

@@ -5,2 +5,11 @@ # Changelog

## [1.2.1](https://github.com/ngneat/elf/compare/state-history-1.2.0...state-history-1.2.1) (2022-08-09)
### Bug Fixes
* **state-history:** fix `EntitiesStateHistory` to make it consider initial entities ([#309](https://github.com/ngneat/elf/issues/309)) ([e78a364](https://github.com/ngneat/elf/commit/e78a36410f5b2a2f772fa0da8cf68f9319c4857e))
# [1.2.0](https://github.com/ngneat/elf/compare/state-history-1.1.0...state-history-1.2.0) (2022-08-05)

@@ -7,0 +16,0 @@

16

index.js
import { isFunction, coerceArray, filterNil, isUndefined } from '@ngneat/elf';
import { BehaviorSubject, map, pairwise, filter as filter$1 } from 'rxjs';
import { BehaviorSubject, map, startWith, pairwise, filter as filter$1 } from 'rxjs';
import { distinctUntilChanged, filter } from 'rxjs/operators';
import { selectEntities, getEntitiesIds, upsertEntities, selectEntity } from '@ngneat/elf-entities';
import { selectEntities, upsertEntities, selectEntity, getEntitiesIds } from '@ngneat/elf-entities';

@@ -217,3 +217,13 @@ class StateHistory {

} else {
this.subscription = this.store.pipe(selectEntities(this.entitiesRef), map(() => this.store.query(getEntitiesIds(this.entitiesRef))), pairwise()).subscribe(([prevEntities, currentEntities]) => {
const getIds = () => {
var _this$store$query;
return (_this$store$query = this.store.query(getEntitiesIds(this.entitiesRef))) != null ? _this$store$query : [];
};
this.subscription = this.store.pipe(selectEntities(this.entitiesRef), map(getIds), startWith(getIds()), pairwise()).subscribe(([prevEntities, currentEntities]) => {
if (!prevEntities.length && !currentEntities.length) {
return;
}
const currentIdsMap = new Set(currentEntities);

@@ -220,0 +230,0 @@ const allChangedIdsMap = new Set([...prevEntities, ...currentEntities]);

2

package.json
{
"name": "@ngneat/elf-state-history",
"version": "1.2.0",
"version": "1.2.1",
"description": "State history management for elf store",

@@ -5,0 +5,0 @@ "publishConfig": {

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