🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@isoftdata/svelte-store-crud

Package Overview
Dependencies
Maintainers
12
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@isoftdata/svelte-store-crud - npm Package Compare versions

Comparing version
2.6.0
to
2.7.0
+4
-1
dist/store.svelte.d.ts

@@ -42,2 +42,5 @@ import type { ConditionalKeys, Simplify } from 'type-fest';

type EntityOrId<T, K extends EntityIdKey<T>> = T | T[K];
export interface CrudRuneStoreOptions<T> {
onchange?: (entity: T, crudType: CrudType) => void;
}
export declare class CrudRuneStore<T, K extends EntityIdKey<T>> implements CrudStoreInterface<T, K> {

@@ -51,3 +54,3 @@ #private;

deletedEntries: Array<[EntityIdValue<T>, T]>;
constructor(idKey: K);
constructor(idKey: K, options?: CrudRuneStoreOptions<T>);
set(value: CrudMap<T> | MapCrudMap<T> | ArrayCrudMap<T>): void;

@@ -54,0 +57,0 @@ static getValuesForSet<T>(values: EntityMap<T> | Map<EntityIdValue<T>, T> | Array<T>): Array<T>;

@@ -125,2 +125,3 @@ import { writable } from 'svelte/store';

#idKey;
#onchange;
// These public properties automatically get getters created

@@ -134,4 +135,5 @@ createdValues = $derived(Array.from(this.#created.values()));

#hasChanges = $derived(!!this.createdValues.length || !!this.updatedValues.length || !!this.deletedValues.length);
constructor(idKey) {
constructor(idKey, options) {
this.#idKey = idKey;
this.#onchange = options?.onchange;
}

@@ -245,2 +247,3 @@ #updateEntity(entity, crudType) {

}
this.#onchange?.(entity, crudType);
}

@@ -247,0 +250,0 @@ toJSON() {

+1
-1
{
"name": "@isoftdata/svelte-store-crud",
"version": "2.6.0",
"version": "2.7.0",
"files": [

@@ -5,0 +5,0 @@ "dist",