Socket
Socket
Sign inDemoInstall

react-hookstore

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hookstore - npm Package Compare versions

Comparing version 1.4.2 to 1.4.3

2

package.json
{
"name": "react-hookstore",
"version": "1.4.2",
"version": "1.4.3",
"description": "A state management library for react using the bleeding edge hooks feature",

@@ -5,0 +5,0 @@ "main": "dist/react-hookstore.js",

@@ -1,45 +0,52 @@

declare module 'react-hookstore' {
type StateCallback<TState> = (state: TState) => void;
type StateCallback<TState> = (state: TState) => void;
type ReducerType<TState, TPayload = any> = (state: TState, payload: TPayload) => TState;
type ReducerType<TState, TPayload = any> = (state: TState, payload: TPayload) => TState;
type SetStateType<TState> = (state: TState, callback?: StateCallback<TState>) => void;
type SetStateType<TState> = (state: TState, callback?: StateCallback<TState>) => void;
type DispatchType<TState, TPayload = any> = (payload: TPayload, callback?: StateCallback<TState>) => void;
type DispatchType<TState, TPayload = any> = (payload: TPayload, callback?: StateCallback<TState>) => void;
type StoreStateHookType<TState> = [TState, SetStateType<TState>];
type StoreStateHookType<TState> = [TState, SetStateType<TState>];
type StoreDispatchHookType<TState> = [TState, DispatchType<TState>];
type StoreDispatchHookType<TState, TPayload = any> = [TState, DispatchType<TState, TPayload>];
const defaultReducer: ReducerType<any>;
const defaultReducer: ReducerType<any>;
export interface StoreSpec<TState> {
state: TState;
reducer: ReducerType<TState>;
setState: SetStateType<TState> | DispatchType<TState>;
setters: StateCallback<TState>[]
}
export interface StoreSpec<TState, TPayload = any> {
state: TState;
reducer: ReducerType<TState, TPayload>;
setState: SetStateType<TState> | DispatchType<TState, TPayload>;
setters: StateCallback<TState>[]
}
export interface StateStoreInterface<TState> {
readonly name: string;
getState(): TState;
setState(state: TState, callback?: StateCallback<TState>): void;
}
export interface StateStoreInterface<TState> {
readonly name: string;
getState(): TState;
setState(state: TState, callback?: StateCallback<TState>): void;
}
export interface ReducerStoreInterface<TState> {
dispatch<TPayload>(payload: TPayload, callback?: StateCallback<TState>): void;
}
export interface ReducerStoreInterface<TState, TPayload = any> {
readonly name: string;
getState(): TState;
dispatch<TPayload>(payload: TPayload, callback?: StateCallback<TState>): void;
}
export function createStore<TState>(name: string, state: TState): StateStoreInterface<TState>;
export function createStore<TState, TPayload = any>(name: string, state: TState, reducer: ReducerType<TState, TPayload>): ReducerStoreInterface<TState, TPayload>;
export function createStore<TState>(name: string, state: TState, reducer: ReducerType<TState>): ReducerStoreInterface<TState>;
export function createStore<TState>(name: string, state: TState): StateStoreInterface<TState>;
export function getStoreByName<TState>(name: string): StateStoreInterface<TState> | ReducerStoreInterface<TState>;
export function createStore<TState>(name: string, state: TState, reducer: ReducerType<TState>): ReducerStoreInterface<TState>;
export function useStore<TState>(identifier: string): StoreStateHookType<TState> | StoreDispatchHookType<TState>;
export function getStoreByName<TState, TPayload = any>(name: string): StateStoreInterface<TState> | ReducerStoreInterface<TState>;
export function useStore<TState>(store: StateStoreInterface<TState>): StoreStateHookType<TState>;
export function getStoreByName<TState>(name: string): StateStoreInterface<TState> | ReducerStoreInterface<TState>;
export function useStore<TState>(store: ReducerStoreInterface<TState>): StoreDispatchHookType<TState>;
export function useStore<TState>(identifier: string): StoreStateHookType<TState> | StoreDispatchHookType<TState>;
export function useStore<TState, TPayload = any>(identifier: string): StoreDispatchHookType<TState, TPayload>;
export function useStore<TState>(store: StateStoreInterface<TState>): StoreStateHookType<TState>;
export function useStore<TState, TPayload = any>(store: ReducerStoreInterface<TState, TPayload>): StoreDispatchHookType<TState, TPayload>;
}
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