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

mobx-ruby

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mobx-ruby

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status Coverage Status Gem Version

Mobx-ruby

An implementation of MobX written in Ruby.

THIS IS JUST A FUN PROJECT!! It is not production ready.

API

## Observables in classes

class ExampleClass
  include Mobx::Extension
  observable :foo, 123
end

example = ExampleClass.new

## Autorun

runner = Mobx.autorun do
  puts "Hello: #{example.foo}"
end

example.foo = 456
# > Hello: 456
example.foo = 789
# > Hello: 789

## Actions (transactions)

Mobx.action do
  example.foo = 123
  example.foo = 999
  example.foo = 1337
end
# > Hello: 1337

## Disposing of autoruns

runner.dispose

## Reactions

Mobx.reaction -> { example.foo } do
  puts "This doesn't look like anything to me"
end
# > This doesn't look like anything to me

example.foo = 333
# > This doesn't look like anything to me

TODO

  • observables are not infectious (observing an array or object will not trigger reactions, not sure how to handle this yet)
  • naming conventions, I was experimenting too much and I'm not happy with the results

FAQs

Package last updated on 25 Apr 2017

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