Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@matchlighter/mobx_model

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matchlighter/mobx_model

A modern, extensible library for building client-side data models upon the principles of OOP.

  • 0.1.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

@matchlighter/mobx_model

A modern, extensible library for building client-side data models upon the principles of OOP.

Defining Models


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

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 * as mobx from 'mobx';
import { initMobxCompat } from '@matchlighter/mobx_model';
initMobxCompat(mobx);

// CommonJS
const mobx = require('mobx');
const mobxModel = require('@matchlighter/mobx_model');
mobxModel.initMobxCompat(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 03 Feb 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc