@phenyl/redux
v4.1.0
Published
phenyl wrapper for redux
Downloads
661
Keywords
Readme
@phenyl/redux
State synchronization among Phenyl CentralState(server) and LocalState(client) using Redux.
usage
Apply phenyl middleware to redux middleware. PhenylHttpClient instance is required to create phenyl middleware for synchronization with CentralState(server).
import { createMiddleware, reducer } from "@phenyl/redux";
import { createStore, applyMiddleware } from "redux";
import PhenylHttpClient from "@phenyl/http-client";
const httpClient = new PhenylHttpClient({ url: "localhost:8080" });
const middleware = createMiddleware({ client: httpClient });
const enhancer = applyMiddleware(middleware);
const store = createStore(reducer, enhancer);
Installation
npm install @phenyl/redux