Stone.js API
    Preparing search index...
    • Class decorator: give the application a store, declaratively.

      @Store() registers the provider that puts every declared store in the container. A component then reaches one through useContainer(), and a service takes it through its constructor, so the same state layer serves SSR, a SPA and React Native without any of them being named here.

      Type Parameters

      • T extends ClassType = ClassType

      Parameters

      Returns ClassDecorator

      A class decorator.

      import { Store, defineStore } from '@stone-js/store'

      @Store({ stores: [defineStore({ name: 'tasks', state: { items: [] } })] })
      @StoneApp({ name: 'my-app' })
      export class Application {}