New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

signalify-store

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

signalify-store

[![npm version](https://badge.fury.io/js/signalify-store.svg)](https://badge.fury.io/js/signalify-store)

latest
Source
npmnpm
Version
1.0.7-experimental
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

signals-store

npm version

A simple store for Preact using Signals.

Install

npm install signalify-store

Usage

import { createStore } from "signalify-store";
// create a store with a default value
const store = createStore({ count: 0 });

// get the value of the store
const count = store((state) => state.count);

// subscribe to the store
count.subscribe((count) => {
	console.log("count", count);
    // => 0
});

// update the store
count.value++;
// => count 1

Persist

const store = createStore(
	{ count: 0 },
	{
		persist: {
			name: "my-app",
			storage: window.localStorage // or window.sessionStorage or window.caches or any other instance of Storage
		},
	},
);

Create a store with the given data and options.

Keywords

signal

FAQs

Package last updated on 24 May 2024

Related posts