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

kea

Package Overview
Dependencies
Maintainers
1
Versions
233
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kea - npm Package Compare versions

Comparing version 0.20.4 to 0.20.5

47

lib/__tests__/logic-connected.js

@@ -191,2 +191,49 @@ 'use strict';

expect(secondLogic.selectors.capitalizedName(store.getState())).toBe('Derpy');
});
test('can get everything with *', function () {
var store = (0, _redux.createStore)((0, _redux.combineReducers)({
scenes: (0, _store.keaReducer)('scenes')
}));
var firstLogic = (0, _kea.kea)({
path: function path() {
return ['scenes', 'homepage', 'first'];
},
actions: function actions(_ref10) {
var constants = _ref10.constants;
return {
updateName: function updateName(name) {
return { name: name };
}
};
},
reducers: function reducers(_ref11) {
var actions = _ref11.actions,
constants = _ref11.constants;
return {
name: ['chirpy', _propTypes2.default.string, _defineProperty({}, actions.updateName, function (state, payload) {
return payload.name;
})]
};
}
});
var secondLogic = (0, _kea.kea)({
path: function path() {
return ['scenes', 'homepage', 'second'];
},
connect: {
props: [firstLogic, ['name', '* as everything']]
}
});
expect(secondLogic._isKeaFunction).toBe(true);
expect(secondLogic._isKeaSingleton).toBe(true);
expect(secondLogic.path).toEqual(['scenes', 'homepage', 'second']);
expect(Object.keys(secondLogic.actions)).toEqual([]);
expect(Object.keys(secondLogic.selectors).sort()).toEqual(['everything', 'name', 'root']);
store.dispatch(firstLogic.actions.updateName('derpy'));
expect(secondLogic.selectors.everything(store.getState())).toEqual({ name: 'derpy' });
});

2

lib/scene/store.js

@@ -258,3 +258,3 @@ 'use strict';

if (typeof reducerTree[pathStart] === 'undefined') {
console.error('[KEA-LOGIC] Path starting with "' + pathStart + '" is not connected to the reducer tree!', path);
console.error('[KEA-LOGIC] Path starting with "' + pathStart + '" is not connected to the reducer tree! Make sure to call keaReducer() before any calls to kea() take place!', path);
return;

@@ -261,0 +261,0 @@ }

{
"name": "kea",
"version": "0.20.4",
"version": "0.20.5",
"description": "Smart front-end architecture",

@@ -5,0 +5,0 @@ "author": "Marius Andra",

@@ -174,1 +174,40 @@ /* global test, expect, beforeEach */

})
test('can get everything with *', () => {
const store = createStore(combineReducers({
scenes: keaReducer('scenes')
}))
const firstLogic = kea({
path: () => ['scenes', 'homepage', 'first'],
actions: ({ constants }) => ({
updateName: name => ({ name })
}),
reducers: ({ actions, constants }) => ({
name: ['chirpy', PropTypes.string, {
[actions.updateName]: (state, payload) => payload.name
}]
})
})
const secondLogic = kea({
path: () => ['scenes', 'homepage', 'second'],
connect: {
props: [
firstLogic, [
'name',
'* as everything'
]
]
}
})
expect(secondLogic._isKeaFunction).toBe(true)
expect(secondLogic._isKeaSingleton).toBe(true)
expect(secondLogic.path).toEqual(['scenes', 'homepage', 'second'])
expect(Object.keys(secondLogic.actions)).toEqual([])
expect(Object.keys(secondLogic.selectors).sort()).toEqual(['everything', 'name', 'root'])
store.dispatch(firstLogic.actions.updateName('derpy'))
expect(secondLogic.selectors.everything(store.getState())).toEqual({ name: 'derpy' })
})

@@ -127,3 +127,3 @@ import { call, take, cancel, fork } from 'redux-saga/effects'

if (typeof reducerTree[pathStart] === 'undefined') {
console.error(`[KEA-LOGIC] Path starting with "${pathStart}" is not connected to the reducer tree!`, path)
console.error(`[KEA-LOGIC] Path starting with "${pathStart}" is not connected to the reducer tree! Make sure to call keaReducer() before any calls to kea() take place!`, path)
return

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