How to use the resolve-redux.createStore function in resolve-redux

To help you get started, we’ve selected a few resolve-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 reimagined / resolve / packages / resolve-scripts / src / defaults / client_index.js View on Github external
import redux from '$resolve.redux'

const initialState = deserializeInitialState(
  viewModels,
  window.__INITIAL_STATE__
)

const origin = window.location.origin

const history = createHistory({
  basename: rootPath
})

const isClient = true

const store = createStore({
  redux,
  viewModels,
  readModels,
  aggregates,
  subscribeAdapter,
  initialState,
  history,
  origin,
  rootPath,
  isClient
})

render(
github reimagined / resolve / examples / with-styled-components / client / ssr.js View on Github external
const ssrHandler = async (
  { seedClientEnvs, constants: { rootPath, staticPath }, utils },
  req,
  res
) => {
  try {
    const { getRootBasedUrl, getStaticBasedPath, jsonUtfStringify } = utils
    const baseQueryUrl = getRootBasedUrl(rootPath, '/')
    const url = req.path.substring(baseQueryUrl.length)
    const history = createMemoryHistory()
    history.push(url)
    const origin = ''

    const store = createStore({ history, origin, rootPath, isClient: false })

    const appContainer = (
      
    )

    const sheet = new ServerStyleSheet()
    const markup = ReactDOM.renderToStaticMarkup(
github reimagined / resolve / examples / with-postcss / client / ssr.js View on Github external
const ssrHandler = async (
  { seedClientEnvs, constants: { rootPath, staticPath }, utils },
  req,
  res
) => {
  try {
    const { getRootBasedUrl, getStaticBasedPath, jsonUtfStringify } = utils
    const baseQueryUrl = getRootBasedUrl(rootPath, '/')
    const url = req.path.substring(baseQueryUrl.length)
    const history = createMemoryHistory()
    history.push(url)
    const origin = ''

    const store = createStore({ history, origin, rootPath, isClient: false })

    const appContainer = (
      
    )

    const markup = ReactDOM.renderToStaticMarkup(appContainer)

    const bundleUrl = getStaticBasedPath(rootPath, staticPath, 'index.js')
github reimagined / resolve / examples / image-gallery / client / index.js View on Github external
const entryPoint = ({ rootPath, staticPath, localS3Constants }) => {
  const origin = getOrigin(window.location)
  const history = createBrowserHistory({ basename: rootPath })

  const store = createStore({
    history,
    origin,
    rootPath,
    isClient: true
  })

  const appContainer = document.createElement('div')
  document.body.appendChild(appContainer)
  render(
    
      
        
      
    ,
    appContainer
  )
github reimagined / resolve / examples / shopping-list-advanced / web / client / ssr.js View on Github external
},
      sagas: [optimisticSharingsSaga, optimisticShoppingListsSaga]
    }

    const baseQueryUrl = getRootBasedUrl(rootPath, '/')
    const origin = ''
    const url = req.path.substring(baseQueryUrl.length)
    const history = createMemoryHistory()
    history.push(url)

    const jwt = {}
    try {
      Object.assign(jwt, jsonwebtoken.decode(req.cookies[jwtCookie.name]))
    } catch (e) {}

    const store = createStore({
      initialState: { jwt },
      redux,
      viewModels,
      subscribeAdapter: {},
      history,
      origin,
      rootPath,
      isClient: false
    })

    const appContainer = (
github reimagined / resolve / examples / hacker-news / client / ssr.js View on Github external
const { rootPath, staticPath, jwtCookie } = constants
    const redux = getRedux(serverImports)
    const routes = getRoutes(serverImports)

    const baseQueryUrl = getRootBasedUrl(rootPath, '/')
    const origin = ''
    const url = req.path.substring(baseQueryUrl.length)
    const history = createMemoryHistory()
    history.push(url)

    const jwt = {}
    try {
      Object.assign(jwt, jsonwebtoken.decode(req.cookies[jwtCookie.name]))
    } catch (e) {}

    const store = createStore({
      initialState: { jwt },
      redux,
      viewModels,
      subscribeAdapter: {},
      history,
      origin,
      rootPath,
      isClient: false
    })

    const appContainer = (
github reimagined / resolve / packages / resolve-scripts / src / runtime / server_side_rendering.js View on Github external
const serverSideRendering = (req, res) => {
  const url = req.params[0] || ''

  const history = createHistory()

  history.push(url)

  const jwt = {}
  try {
    Object.assign(jwt, jsonwebtoken.decode(req.cookies[jwtCookie.name]))
  } catch (e) {}

  const origin = ''

  const store = createStore({
    redux,
    viewModels,
    readModels,
    aggregates,
    subscribeAdapter,
    initialState: {
      jwt
    },
    history,
    origin,
    rootPath,
    isClient: false
  })

  const sheet = new ServerStyleSheet()
  const markup = ReactDOM.renderToStaticMarkup(