Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-hooks-global-state

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hooks-global-state - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

4

CHANGELOG.md

@@ -5,2 +5,6 @@ # Change Log

## [0.9.0] - 2019-03-18
### Changed
- Better typings for optional initialState
## [0.8.0] - 2019-03-16

@@ -7,0 +11,0 @@ ### Changed

@@ -18,2 +18,4 @@ import * as React from 'react';

export type ReduxLikeReducer<S, A> = (state: S | undefined, action: A | { type: undefined }) => S;
export type Dispatch<A> = (action: A) => A;

@@ -48,3 +50,9 @@

export type CreateReduxLikeStore = <S, A>(
reducer: ReduxLikeReducer<S, A>,
initialState: S | undefined,
enhancer?: Enhancer<S, A> | AnyEnhancer,
) => Store<S, A>;
export const createGlobalState: CreateGlobalState;
export const createStore: CreateStore;
export const createStore: CreateStore | CreateReduxLikeStore;

2

package.json
{
"name": "react-hooks-global-state",
"description": "Simple global state for React with Hooks API",
"version": "0.8.0",
"version": "0.9.0",
"author": "Daishi Kato",

@@ -6,0 +6,0 @@ "repository": {

@@ -76,3 +76,3 @@ # react-hooks-global-state

};
const initialState = { counter: 0 }; // initialState is not optional.
const initialState = { counter: 0 };
const { GlobalStateProvider, dispatch, useGlobalState } = createStore(reducer, initialState);

@@ -140,2 +140,3 @@

- [Ideas](https://github.com/dai-shi/react-hooks-global-state/wiki/Ideas)
- [Persistence](https://github.com/dai-shi/react-hooks-global-state/wiki/Persistence)
- [Optional initialState](https://github.com/dai-shi/react-hooks-global-state/wiki/Optional-initialState)

@@ -18,2 +18,4 @@ import * as React from 'react';

export type ReduxLikeReducer<S, A> = (state: S | undefined, action: A | { type: undefined }) => S;
export type Dispatch<A> = (action: A) => A;

@@ -48,3 +50,9 @@

export type CreateReduxLikeStore = <S, A>(
reducer: ReduxLikeReducer<S, A>,
initialState: S | undefined,
enhancer?: Enhancer<S, A> | AnyEnhancer,
) => Store<S, A>;
export const createGlobalState: CreateGlobalState;
export const createStore: CreateStore;
export const createStore: CreateStore | CreateReduxLikeStore;
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