Socket
Socket
Sign inDemoInstall

@mantine/store

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mantine/store - npm Package Compare versions

Comparing version 7.0.0-alpha.13 to 7.0.0-alpha.14

5

cjs/store.js

@@ -15,4 +15,7 @@ 'use strict';

},
updateState(value) {
state = typeof value === "function" ? value(state) : value;
},
setState(value) {
state = value;
this.updateState(value);
listeners.forEach((listener) => listener(state));

@@ -19,0 +22,0 @@ },

@@ -11,4 +11,7 @@ import { useSyncExternalStore } from 'react';

},
updateState(value) {
state = typeof value === "function" ? value(state) : value;
},
setState(value) {
state = value;
this.updateState(value);
listeners.forEach((listener) => listener(state));

@@ -15,0 +18,0 @@ },

7

lib/store.d.ts
export type MantineStoreSubscriber<Value> = (value: Value) => void;
type SetStateCallback<Value> = (value: Value) => Value;
export interface MantineStore<Value> {
getState(): Value;
setState(value: Value): void;
setState(value: Value | SetStateCallback<Value>): void;
updateState(value: Value | SetStateCallback<Value>): void;
initialize(value: Value): void;

@@ -9,3 +11,4 @@ subscribe(callback: MantineStoreSubscriber<Value>): () => void;

export type MantineStoreValue<Store extends MantineStore<any>> = ReturnType<Store['getState']>;
export declare function createStore<Value>(initialState: Value): MantineStore<Value>;
export declare function createStore<Value extends Record<string, any>>(initialState: Value): MantineStore<Value>;
export declare function useStore<Store extends MantineStore<any>>(store: Store): ReturnType<Store["getState"]>;
export {};
{
"name": "@mantine/store",
"version": "7.0.0-alpha.13",
"version": "7.0.0-alpha.14",
"types": "./lib/index.d.ts",

@@ -32,3 +32,3 @@ "exports": {

"peerDependencies": {
"react": ">=16.8.0"
"react": ">=18.0.0"
},

@@ -35,0 +35,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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