JSPM

  • Created
  • Published
  • 0
  • Score
    100M100P100Q30467F
  • License MIT

The state management module for the TiniJS framework.

Package Exports

  • @tinijs/store
  • @tinijs/store/src/public-api.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tinijs/store) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

TiniJS Store

The state management module for the TiniJS framework.

It uses the Tinyx under the hood.

Install

To manually install the module: npm i @tinijs/store

It is recommended to download the Skeleton for a ready-to-use structured project.

For more, please visit: https://tinijs.dev

Usage

  • Add the states.ts
import {TiniStore} from '@tinijs/store';

const states = {
  key: 'value',
};

export default states;
export type States = typeof states;

export type Store = TiniStore<States>;
  • Create a store instance in the app.ts
import {createStore} from '@tinijs/store';

import states, {Store} from './states';

@App()
export class AppRoot extends TiniComponent {
  $store!: Store;

  onReady() {
    this.$store = createStore(states);
  }
}

API

// TODO

Developement

  • Create a home for TiniJS: mkdir TiniJS && cd TiniJS
  • Fork the repo: git clone https://github.com/tinijs/store.git
  • Install dependencies: cd store && npm i
  • Make changes & preview locally: npm run build && npm pack
  • Push changes & create a PR 👌

License

@tinijs/store is released under the MIT license.