TS Basis
TS Basis is a general toolbox library based on Typescript for augmenting the standard library offered by browsers and other JS runtimes like Node.js. TS Basis library mainly aims to resolve data modeling and syncing between client and server that is currently missing from the MobX and other React libraries, similar in function for Lodash but heavily accentuating server-side ops and data syncing.
TS Basis comes from parent project group MobX. TS Basis is currently at version 5 and is under beta (active proposals and development scoped from 2022 to 2026 year-end). This will be the case until major version 10 where the interfaces and specification will be locked and ratified by the parent project group.
Intallation
You can add ts-basis
toolbox to your project by running:
npm i ts-basis
# or if you're using yarn or pnpm
yarn add ts-basis
pnpm i ts-basis
After this, you can import features offered by ts-basis
import { dataclass } from 'ts-basis'
@dataclass({ classVersion: semver('1.0.0') })
class MyClass {
id: string = ''
name: string = ''
constructor(init?: Partial<MyClass>) {
Object.assign(this, init)
}
}