Skip to content

Releases: crazko/use-dencrypt-effect

v2.0.0

12 Mar 20:22
Compare
Choose a tag to compare

Added

A complete rewrite. Now it is possible to set initial value and/or set new value to be the same as the previous one.

API is similar to React's useState, it returns a tuple:

import { useDencrypt } from "use-dencrypt-effect";

const Example = () => {
  const [value, setValue] = useDencrypt("initial value");

  return <div onClick={() => setValue("new value")}>{value}</div>;
};

It is also possible to import just core function and use it without React:

import { dencrypt } from "use-dencrypt-effect";

const setValue = dencrypt({
  initialValue: "initial value",
  callback: (value) => {
    element.textContent = value;
  },
});

Changed

  • Migrated to Vite and Vitest.

Full Changelog: v1.0.2...v2.0.0

v1.0.2

22 Feb 13:58
Compare
Choose a tag to compare

Small changes, mostly regarding documentation.

Added

  • new example under Other Examples in README

Removed

  • package-lock.json from the npm package

Fixed

  • code example in README