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

@cerebral/fluent

Package Overview
Dependencies
Maintainers
5
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cerebral/fluent - npm Package Compare versions

Comparing version 1.0.0-1518821845306 to 1.0.0-1518858486644

26

lib/index.test.js

@@ -128,2 +128,28 @@ /* eslint-env mocha */

});
it('should allow getters', () => {
const Sequence = SequenceFactory();
const signal = Sequence((s) => s.action(function test({ state }) {
state.foo = 'bar2';
}));
let hasUpdated = 0;
const rootModule = Module({
state: {
foo: 'bar',
get test() {
return this.foo.toUpperCase();
}
},
signals: {
test: signal
}
});
const controller = Controller(rootModule);
autorun(() => {
controller.state.test;
hasUpdated++;
});
assert.equal(controller.state.test, 'BAR');
controller.signals.test();
assert.equal(hasUpdated, 2);
});
it('should work with fluent api', () => {

@@ -130,0 +156,0 @@ const Sequence = SequenceFactory();

6

lib/Model.js

@@ -317,3 +317,7 @@ import { extractModuleProp, isObject, BaseModel } from 'cerebral/internal';

const extended = extendObservable(root, Object.keys(extension).reduce((root, key) => {
if (extension[key] instanceof ComputedClass) {
const propertyDescriptor = Object.getOwnPropertyDescriptor(extension, key);
if (propertyDescriptor && 'get' in propertyDescriptor) {
Object.defineProperty(root, key, propertyDescriptor);
}
else if (extension[key] instanceof ComputedClass) {
extension[key].getState = () => ({ state: extended, root: this.state });

@@ -320,0 +324,0 @@ root[key] = extension[key];

4

package.json
{
"name": "@cerebral/fluent",
"version": "1.0.0-1518821845306",
"version": "1.0.0-1518858486644",
"description": "Makes Cerebral typescript friendly",

@@ -27,3 +27,3 @@ "main": "index.js",

"dependencies": {
"cerebral": "^4.2.0-1518821845307",
"cerebral": "^4.2.0-1518858486644",
"mobx": "^3.4.1"

@@ -30,0 +30,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