Skip to content
This repository has been archived by the owner on Mar 26, 2022. It is now read-only.

Releases: kqito/use-global-context

v0.8.0

15 May 07:00
Compare
Choose a tag to compare

Overview

#46

Features

  • Change getStore to stateController
    • This object is including some function to manage state like as getStore
    • Add a description of this function to README.md

Bug fix

  • Fix an context reference bug after HMR.

v0.7.5

21 Apr 07:18
Compare
Choose a tag to compare

PR: #45

Features

  • Add state props to GlobalContextProvider
    • This function is useful when inherit SSRed state on the browser.

Changes

  • Rename CreateGlobalContextArgs to GlobalContextReducers

Document

  • Add a description about state props of GlobalContextProvider

v0.7.4

20 Apr 14:24
Compare
Choose a tag to compare

Overview

PR: #44

Core changes

  • Change the type of initialState from any to Record<string, any>

New API

  • Add mergeInitialState API
    • This API is useful for inheriting the value of the store from the SSR in the browser.

Document

  • Add each API's description and usages.
    • Add about mergeInitialState
    • Add about getStore
    • Add about equalityFunction

v0.7.2

20 Apr 14:13
e4e257e
Compare
Choose a tag to compare

Overview

  • Fix a bug in which Context values were not reflected.

v0.7.3

20 Apr 14:21
Compare
Choose a tag to compare

Overview

PR: #43

Minor changes

  • Fixed a bug that caused unneeded objects to be updated when a state was changed.

Tests

  • Add SSR test with using renderToString
  • Improve test coverage

v0.7.0

18 Apr 15:14
Compare
Choose a tag to compare

Overview (core changes is included)

  • Add createGlobalContext API
  • Remove createUseStateContext API
  • Remove createUseReducerContext API

API

createGlobalContext

createGlobalContext is same usage with createUseReducerContext and createUseStateContext.
Since createUseReducer uses useReducer internally, there are some unnecessary renders that are unavoidable.
This has been fixed and renamed to createGlobalContext API.