@furystack/core

15.0.23 • Public • Published

@furystack/core

Core package for FuryStack with generic type and interface definitions and concepts.

Concepts

Physical Store

In FuryStack, the preferred way to access data is via physical stores. A physical store is a minimal interface that a store should implement. A store is always bound to a collection with a specified type of entities. It can only do basic CRUD operations (create, get by ID, filter, delete, count). These stores should not have concepts about relations, indexes, or other storage-specific details. Data stores don't care about permission, role, or session checking.

Identity Context

The generic way to implement authentication and authorization logic is with an Identity Context – you can use it on both backend and frontend.

User

...yo...

Other Utilities

Global Disposables

Global Disposables is a list you can fill with disposables that will be disposed on app exit – this helps with graceful app shutdowns.

import { globalDisposables } from '@furystack/core/dist/create-physical-store-tests'

globalDisposables.add(myRootInjector)

Generic Tests for Physical Stores

There is a set of generic store tests you can use to test your custom store implementation, as the following example shows:

import { TestClass, createStoreTest } from '@furystack/core/create-physical-store-tests'

describe('myStore', () => {
  createStoreTest({
    createStore: () => new MyStoreImplementation(TestClass, ...ctorArgs),
    typeName: 'MyStoreImplementation',
  })
})

Readme

Keywords

Package Sidebar

Install

npm i @furystack/core

Weekly Downloads

383

Version

15.0.23

License

GPL-2.0

Unpacked Size

210 kB

Total Files

99

Last publish

Collaborators

  • gallayl