Skip to content
This repository has been archived by the owner on Apr 25, 2021. It is now read-only.

Changelog

Alec Aivazis edited this page Dec 29, 2016 · 14 revisions

Changelog

This page describes various changes in the API as well as the migration path to each version where applicable.

Version 4.1

The initial media type can be set with the initialMediaType argument to the reducer factory.

Version 4.0

This version introduced a number of changes into the codebase resulting in a much more performant experience for the general user as well as adding increased support for adapting the responsive state to fit your particular use case.

StoreEnhancer

  • calculateStateInitially is now calculateInitialState
  • performanceMode is now default (no more throttled handler or associated options)

Reducer / Responsive State

  • no more height/width (see README for instructions on migration forward)
  • Added is field to responsiveState (browser.is.small <=> browser.mediaType === "small")
  • ReducerFactory now accepts options as second argument (after breakpoints)
  • infinityType argument is now the infinity field of the argument
  • user-defined fields can be added to the responsive state with the extraFields option which is defined as a function that takes the current responsive state and returns the new fields to add (is spread over old state so user could also overwrite values if they wanted)

Version 3.1

  • Added performanceMode to store enhancer factory. See documentation for more details.

Version 3.0

  • Added support for non-react environments by moving the StyleSheet higher-order component to redux-responsive/react. Removed "orEqual" variations to reduce computations when browser is resizing.

Version 2.2

  • added "orEqual" variations in responsive state to remove coupling across breakpoints (ie, not having to remember "superLarge" comes right after "larger")

Version 2.1

  • added StyleSheet higher-order component. See readme for details.

Version 2.0

  • addResponsiveHandlers was removed (previously deprecated) in favor of responsiveStoreEnchaner.
  • enhancer factory options are now passed as an object, instead of arguments.
  • Examples:
import {responsiveStoreEnhancer} from 'redux-responsive'

// adding the store enhancer to the factory
const store = createStore(
    reducer,
    compose(
        responsiveStoreEnhancer,
        applyMiddlewares(middleware1, middleware2)
    )
)
// passing configuration options to the factory

import {createResponsiveStoreEnhancer} from 'redux-responsive'

const store = createStore(
    reducer,
    compose(
        createResponsiveStoreEnhancer({throttleTime: 400}), // used to be createResponsiveStoreEnhancer(400)
        applyMiddlewares(middleware1, middleware2)
    )
)