JSPM

  • Created
  • Published
  • Downloads 4119
  • Score
    100M100P100Q126120F
  • License MIT

A high-level, declarative, composable form of Redux

Package Exports

  • @zedux/core

Readme

@zedux/core

This package includes the core composable store model of Zedux. It exports several utilities and TypeScript types for working with Zedux stores.

If you're new to Zedux, you're probably looking for the quick start.

Installation

npm install @zedux/core # npm
yarn add @zedux/core # yarn
pnpm add @zedux/core # pnpm

If you're using React, you probably want to install the @zedux/react package instead, which includes everything from this package and more.

Usage

See the top-level README for a general overview of Zedux.

See the Zedux documentation for comprehensive usage details.

Basic example:

import { createStore } from '@zedux/core'

// a zero-config store:
const store = createStore(null, 'Hello, World!')

const subscription = store.subscribe((newState, oldState) => {
  console.log('store went from', oldState, 'to', newState)
})

store.getState() // 'Hello, World!'
store.setState('Goodbye, World!')

Exports

This package exports the following APIs, along with many TypeScript types for working with them:

Classes

Factories

Utils

For Authors

If your package only depends on APIs in this package, it's recommended to only import this package, not @zedux/atoms or @zedux/react. This package is small enough that you may consider bundling it in with your code, but that shouldn't be necessary.

Contributing, License, Etc

See the top-level README for all the technical stuff.