Socket
Socket
Sign inDemoInstall

colyseus-mobx

Package Overview
Dependencies
2
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    colyseus-mobx

a mobx view of colyseus state


Version published
Weekly downloads
2
Maintainers
2
Install size
12.4 kB
Created
Weekly downloads
 

Readme

Source

colyseus-mobx

a mobx view of colyseus state. continues the work in https://github.com/a-rts/colyseus-mobx

version support

Written for Mobx 5.x, but should probably work with other Mobx versions.

Due to breaking API changes in Colyseus, this version only supports Colyseus 0.14 and above (@colyseus/schema >= 1.0.2)

Pending support

The schema types new to Colyseus 0.14 (CollectionSchema and SetSchema) are not yet supported. please open an issue if you would like to use them.

Installation

npm install colyseus-mobx --save

How to use

Import getMobxView and call it once when connecting to a room on the client side,

import { getMobxView } from 'colyseus-mobx';
const room: Room<GameState> = await client.joinOrCreate("game");
const mobxState = getMobxView(room.state);

then you can wire observers to mobxState and start rendering.

Developer instructions

Installing workspace

to install a development environment, you need to have node.js git installd. Then, git clone this repo locally and run:

$ npm install
$ npm test

and that's it, you've just installed the development environment!

This project is written with VSCode in mind. specifically configured for these extensions: dbaeumer.vscode-eslint, esbenp.prettier-vscode.

test

npm run test

execute all tests.

clean

npm run clean

Removes any built code and any built executables.

build

npm run build

Cleans, then builds the library.

Your built code will be in the ./dist/ directory.

FAQs

Last updated on 05 Nov 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc