How to use ld-redux - 4 common examples

To help you get started, we’ve selected a few ld-redux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yusinto / ld-redux / example / src / client / index.js View on Github external
import React from 'react';
import { hydrate } from 'react-dom';
import { Router, browserHistory } from 'react-router';
import routes from '../universal/routes';
import { Provider } from 'react-redux';
import createStore from '../universal/redux/store';
import ldRedux from 'ld-redux';
import flags from '../../flags.json';

const reduxState = window.__INITIAL_STATE__ || undefined;
const store = createStore(reduxState);

ldRedux.init({
  clientSideId: '59b2b2596d1a250b1c78baa4',
  dispatch: store.dispatch,
  flags,
});

hydrate(
  
    
  ,
  document.getElementById('reactDiv'),
);
github yusinto / ld-redux / example / src / universal / domain / home / homeContainer.js View on Github external
const mapStateToProps = (state) => {
  const homeState = state.Home;
  const flags = ldRedux.getFlags(state, homeFlags);

  return {
    ...homeState,
    ...flags,
  };
};
github yusinto / ld-redux / example / src / universal / domain / home / homeContainer.js View on Github external
import HomeComponent from './homeComponent';
import ldRedux, {ldConnect} from 'ld-redux';
import {homeFlags} from './homeLogic';

const mapStateToProps = (state) => {
  const homeState = state.Home;
  const flags = ldRedux.getFlags(state, homeFlags);

  return {
    ...homeState,
    ...flags,
  };
};

@connect(mapStateToProps, homeActions)
@ldConnect(homeFlags)
export default class HomeContainer extends Component {
  render() {
    return ;
  }
}
github yusinto / ld-redux / example / src / universal / redux / reducer.js View on Github external
import { combineReducers } from 'redux';
import Home from '../domain/home/homeReducer';
import ldRedux from 'ld-redux';

export default combineReducers({
  Home,
  LD: ldRedux.reducer(),
});

ld-redux

A library to integrate launch darkly with react redux

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis