SyncState

SyncState

  • Docs
  • FAQ
  • Github
  • Hire The Creators

›API Reference

Introduction

  • Getting started
  • Installation
  • Motivation
  • Core Concepts

Recipes

  • Recipes

Examples

  • Counter
  • Counter with Undo / Redo
  • Todo app
  • Multi User Counter
  • Multi User Todo
  • Multi User Todo With Undo/Redo

Plugins

  • History
  • Remote

API Reference

  • API Overview
  • createDocStore
  • Store
  • Provider
  • useDoc
  • useSyncState

Tips & Tricks

  • Common Pitfalls & Best Practices
  • Using SyncState without React
  • Performance Tuning

FAQ

  • FAQ's

createDocStore

Creates a SyncState store that holds your document/app state. There should only be a single store in your app.

Arguments

  1. initialDoc (Object): The initial document/state.
  2. plugins (Array?): SyncState Plugins which can add a middleware for the internal Redux store and provide extra functionality.

Returns

(store): An object that holds a document representing the complete state of your app.

Example

import { createDocStore } from "@syncstate/core";
import history from "@syncstate/history";

const store = createDocStore({ todos: [], filter: "all" }, [
    history.createInitializer(),
]);
← API OverviewStore →
Docs
Getting StartedExamplesPluginsAPI ReferenceFAQ
Community
TwitterStack OverflowDiscord
More
GitHub   Contribution Guidelines
Stars
Built with ❤️ at GeekyAnts.
Copyright © 2020 SyncState