New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

microcosm

Package Overview
Dependencies
Maintainers
4
Versions
233
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

microcosm - npm Package Versions

1
24

12.9.0-beta

Diff

nhunzaker
published 12.9.0-alpha •

nhunzaker
published 12.8.0 •

Changelog

Source

12.8.0

  • The current repo is passed as the second argument of Presenter::getModel state key callbacks
nhunzaker
published 12.7.0 •

Changelog

Source

12.7.0

  • Remove PropType usage from addons to prevent React 15.5.x deprecation warnings.
  • Added configurable teardown method to the Microcosm prototype. This behaves similarly to teardown methods on other Microcosm classes.
  • Fixed a bug where the first action dispatched would always fire a change event, even if state didn't change.
  • The first argument of repo.push is passed into the open state of actions that return promises.
  • Action status changing methods are auto-bound, and will warn when a completed action attempts to move into a new state (strict mode only)
  • Added batch as an option when instantiating Microcosm. When set to true, high frequency change events will be batched together using requestIdleCallback. When not available, it falls back to setTimeout.

Auto-bound action status methods

Action status methods like action.resolve() and action.reject() are auto-bound. They can be passed directly into a callback without needing to wrap them in an anonymous function.

This is particularly useful when working with AJAX libraries. For example, when working with superagent:

Instead of:

import superagent from 'superagent'

function getPlanets() {
  return action => {
    let request = superagent.get('/planets')

    request.on('request', data => action.open(data))
    request.on('progress', data => action.update(data))
    request.on('abort', data => action.cancel(data))

    request.then(data => action.resolve(data), error => action.reject(error))
  }
}

You can do:

import superagent from 'superagent'

function getPlanets() {
  return action => {
    let request = superagent.get('/planets')

    request.on('request', action.open)
    request.on('progress', action.update)
    request.on('abort', action.cancel)

    request.then(action.resolve, action.reject)
  }
}
nhunzaker
published 12.7.0-beta •

nhunzaker
published 12.7.0-alpha.4 •

nhunzaker
published 12.7.0-alpha.3 •

nhunzaker
published 12.7.0-alpha.2 •

nhunzaker
published 12.7.0-alpha.1 •

nhunzaker
published 12.7.0-alpha.0 •

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