Closed minjiewang29 closed 2 years ago
`"use strict"
var stampit = require('stampit')
module.exports = stampit() .init(function () { this.state = this.state || {} }) .static({ handlers (newHandlers) { this.fixed.refs._handlers = this.fixed.refs._handlers || {} Object.assign(this.fixed.refs._handlers, newHandlers) return this } }) .methods({ digest (action, ...data) { if (this._handlers[action]) { this._handlers[action].call(this, this.state, ...data) } }, addDispatcher (dispatcher) { this.dispatcher = dispatcher this.dispatch = this.dispatcher.dispatch.bind(this.dispatcher) } }) `
Thanks for doing it by yourself mate.
For others, the way to upgrade can be found by link in README. See Status: https://github.com/stampit-org/stampit#status
`"use strict"
var stampit = require('stampit')
module.exports = stampit() .init(function () { this.state = this.state || {} }) .static({ handlers (newHandlers) { this.fixed.refs._handlers = this.fixed.refs._handlers || {} Object.assign(this.fixed.refs._handlers, newHandlers) return this } }) .methods({ digest (action, ...data) { if (this._handlers[action]) { this._handlers[action].call(this, this.state, ...data) } }, addDispatcher (dispatcher) { this.dispatcher = dispatcher this.dispatch = this.dispatcher.dispatch.bind(this.dispatcher) } }) `