npm dexie 4.0.5
Dexie v4.0.5

latest release: 4.0.7
one month ago

Features

New CRDT operations: add() and remove() (#1936)

New operations that works consistently across sync: Mathematical addition/subtraction as well as adding or removing string or numbers from array properties.

Add to set

It is now possible to add items to an array property using a sync consistent operation "add":

import { add } from "dexie";

db.friends.update(friend.id, {
  hobbies: add([
    "skating",
    "football"
  ])
});

Remove from set

import { remove } from "dexie";

db.friends.update(friend.id, {
  hobbies: remove([
    "curling"
  ])
});

Mathematical addition and subtraction (number)

import { add, remove } from "dexie";

await db.transaction('rw', db.accounts, () => {
  db.accounts.update(accountId1, { balance: remove(100) });
  db.accounts.update(accountId2, { balance: add(100) });
});

Mathematical addition and subtraction (bigint)

import { add, remove } from "dexie";

await db.transaction('rw', db.accounts, () => {
  db.accounts.update(accountId1, { balance: remove(100n) });
  db.accounts.update(accountId2, { balance: add(100n) });
});

Typings

  • #1998 TInsertType in table methods on Dexie and Transaction

Bug fixes

  • export ./dist/dexie.mjs (#1997)
  • Fix missing idbtrans in transaction (#1985)

dexie-cloud-addon@4.0.6

Don't miss a new dexie release

NewReleases is sending notifications on new releases.