How to use the @edtr-io/store.createStore function in @edtr-io/store

To help you get started, we’ve selected a few @edtr-io/store 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 edtr-io / edtr-io / packages / public / renderer / src / index.tsx View on Github external
export function Renderer({
  createStoreEnhancer = defaultEnhancer => defaultEnhancer,
  theme = {},
  ...props
}: RendererProps) {
  const { store } = createStore({
    instances: {
      main: {
        plugins: props.plugins,
        defaultPlugin: ''
      }
    },
    createEnhancer: createStoreEnhancer
  })

  store.dispatch(
    initRoot({
      initialState: props.state,
      plugins: props.plugins,
      defaultPlugin: ''
    })('main')
  )
github edtr-io / edtr-io / packages / renderer / src / index.tsx View on Github external
export function Renderer({
  createStoreEnhancer = defaultEnhancer => defaultEnhancer,
  theme = {},
  ...props
}: RendererProps) {
  const { store } = createStore({
    instances: {
      main: {
        plugins: props.plugins,
        defaultPlugin: ''
      }
    },
    createEnhancer: createStoreEnhancer
  })

  store.dispatch(
    initRoot({
      initialState: props.state,
      plugins: props.plugins,
      defaultPlugin: ''
    })('main')
  )