PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@celo/contractkit/node_modules/fp-ts/es6
Просмотр файла: IORef.js
/**
* @example
* import { io } from 'fp-ts/lib/IO'
* import { newIORef } from 'fp-ts/lib/IORef'
*
* assert.strictEqual(io.chain(newIORef(1), ref => io.chain(ref.write(2), () => ref.read))(), 2)
*
* @since 2.0.0
*/
var IORef = /** @class */ (function () {
function IORef(value) {
var _this = this;
this.value = value;
this.read = function () { return _this.value; };
}
/**
* @since 2.0.0
*/
IORef.prototype.write = function (a) {
var _this = this;
return function () {
_this.value = a;
};
};
/**
* @since 2.0.0
*/
IORef.prototype.modify = function (f) {
var _this = this;
return function () {
_this.value = f(_this.value);
};
};
return IORef;
}());
export { IORef };
/**
* @since 2.0.0
*/
export function newIORef(a) {
return function () { return new IORef(a); };
}
Выполнить команду
Для локальной разработки. Не используйте в интернете!