@wethecurious/curios-reduxmiddleware-analytics

0.0.8 • Public • Published

CURIOS MIDDLEWARE REDUX SERIAL

Rationale

This middleware will establish a connection an mqtt connection to the analytics database to allow actions to be logged

If not connected to mqtt it will fall back to a non functional stub which will simulate action dispatches

Installation

npm i -s @wethecurious/curios-redux-middleware-analytics

At your createStore

import { createAnalyticsMiddleware } from 'redux-middleware-analytics'

const mqttMiddleware = createAnalyticsMiddleware({
    app: string,
    mqttBroker: 'localhost:1883'
})

const store = createStore(
  reducer,
  applyMiddleware(mqttMiddleware)
)

store.dispatch('@@CURIOS_INIT') // this is the desfault action which tells the analytics to attempt to connect

Readme

Keywords

none

Package Sidebar

Install

npm i @wethecurious/curios-reduxmiddleware-analytics

Weekly Downloads

0

Version

0.0.8

License

MIT

Unpacked Size

4.61 kB

Total Files

4

Last publish

Collaborators

  • shved90
  • fastboy
  • benvium