@christophediprima/razzle-react-redux-observable-found

Bootstrap a full SRR React App with Typescript, Redux-Observable and Found

Usage no npm install needed!

<script type="module">
  import christophediprimaRazzleReactReduxObservableFound from 'https://cdn.skypack.dev/@christophediprima/razzle-react-redux-observable-found';
</script>

README

razzle-react-redux-observable-found

Bootstrap Razzle full SRR React App with Redux-Observable and Found

Install

npm install --save razzle-react-redux-observable-found

Basic Usage

// server.ts
import express from 'express';

import { createServerConfig } from '@christophediprima/razzle-react-redux-observable-found';

import Action from './core/Action';
import State from './core/State';

import rootEpic from './core/rootEpic';
import rootReducer from './core/rootReducer';
import routes from './core/routes';

const razzleAssets = require(process.env.RAZZLE_ASSETS_MANIFEST || '');
const server = express();

const initialState = {
  board: {
    list: [],
    loading: false,
  },
};

const serverConfig = createServerConfig<State, Action>({ initialState, razzleAssets, rootEpic, rootReducer, routes });

server
  .disable('x-powered-by')
  .use(express.static(process.env.RAZZLE_PUBLIC_DIR || ''))
  .get('/*', serverConfig);

export default server;
// client.ts
import './client.css';

import { createClientConfig } from '@christophediprima/razzle-react-redux-observable-found';

import Action from './core/Action';
import State from './core/State';

import rootEpic from './core/rootEpic';
import rootReducer from './core/rootReducer';
import routes from './core/routes';

createClientConfig<State, Action>(rootEpic, rootReducer, routes);

Have a look at the example for usage with a custom document and extra providers!

razzle-react-redux-observable-found is build with create-react-library

Inspirations

License

MIT © christophediprima