Skip to content

iotes/redux-hooks

Repository files navigation

Introduction

This Plugin intergrates iotes with redux projects. This is the recommended plugin to use for redux based projects for most cases as opposed to react-redux.

In this plugin the host updates get dispatched through the redux dispatch system while the device data comes from a useIotesDevice hook. This means you can handle big events like connection and disconnection of devices through the redux store without causing an excessive amount of actions to come through on the redux store

Usage

    // Create iotes plugin
    const { useIotesDevice, iotesHostMiddleware, subscribeToHost } = createIotesReactReduxHook(topology, strategy)
    // create store applying middleware
    const store = createStore(genericReducer, applyMiddleware(iotesHostMiddleware))
    // inject the store dispatcher in order to subscribe to iotes host
    subscribeToHost(store.dispatch)  

About

The iotes plugin that runs host messages through redux and device messages using hooks

Resources

Stars

Watchers

Forks