🚨 Shai-Hulud Strikes Again:More than 500 packages and 700+ versions compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@matchlighter/decsera

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matchlighter/decsera

A modern decorator-based, extensible library for building client-side data models for easy hydration of JSON data.

latest
npmnpm
Version
0.4.4
Version published
Maintainers
0
Created
Source

Decsera (Previously @matchlighter/mobx_model)

A modern decorator-based, extensible library for building client-side data models for easy hydration of JSON data.

Defining Models


import { Model, field } from '@matchlighter/decsera';

class User extends Model {
    @field full_name: string;
    @field({ /* options */ }) username: string;

    @collection({ type: 'local' }) projects: Project[] = [];
}

MobX

This library was originally built with MobX support built in out of the box. However, MobX support was refactored to a separate module before the first public release. MobX support can be enabled like such:

// ES6
import "@matchlighter/decsera/mobx"; // Must be placed *before* any other imports of DecSera

// CommonJS
require('@matchlighter/decsera/mobx');

With MobX support enabled,

  • @field automatically applies MobX @observable
  • @observable / @computed are automatically applied in other appropriate locations
  • Some other optimizations are made for supporting MobX & other features

FAQs

Package last updated on 07 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts