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

@rallie/vue

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rallie/vue - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

dist/mixin.js

1

dist/index.d.ts
export * from './hooks';
export * from './mixins';

@@ -38,2 +38,78 @@ import { ref, onBeforeUnmount, onBeforeMount } from 'vue';

export { eventsHook, methodsHook, stateHook };
var stateMixin = function (app) { return function (mapStateToComputed) {
var unwatchState = null;
var computed = {};
var mappedState = mapStateToComputed(app.state);
var dataKey = "rallie-state-".concat(app.name);
Object.keys(mappedState).forEach(function (key) {
computed[key] = function () {
return this[dataKey][key];
};
});
return {
data: function () {
var _a;
var result = (_a = {},
_a[dataKey] = mappedState,
_a);
return result;
},
computed: computed,
created: function () {
var _this = this;
unwatchState = app.watchState(mapStateToComputed).do(function (value) {
_this[dataKey] = value;
});
},
beforeDestroy: function () {
unwatchState();
},
beforeUnmount: function () {
unwatchState();
}
};
}; };
var eventsMixin = function (app) { return function (events) {
var offEvents = null;
return {
methods: events,
created: function () {
var _this = this;
var _events = {};
Object.entries(events).forEach(function (_a) {
var key = _a[0], Fn = _a[1];
_events[key] = Fn.bind(_this);
});
offEvents = app.listenEvents(_events);
},
beforeDestroy: function () {
offEvents();
},
beforeUnmount: function () {
offEvents();
}
};
}; };
var methodsMixin = function (app) { return function (methods) {
var offMethods = null;
return {
methods: methods,
created: function () {
var _this = this;
var _methods = {};
Object.entries(methods).forEach(function (_a) {
var key = _a[0], Fn = _a[1];
_methods[key] = Fn.bind(_this);
});
offMethods = app.addMethods(_methods);
},
beforeDestroy: function () {
offMethods();
},
beforeUnmount: function () {
offMethods();
}
};
}; };
export { eventsHook, eventsMixin, methodsHook, methodsMixin, stateHook, stateMixin };

@@ -42,5 +42,84 @@ (function (global, factory) {

var stateMixin = function (app) { return function (mapStateToComputed) {
var unwatchState = null;
var computed = {};
var mappedState = mapStateToComputed(app.state);
var dataKey = "rallie-state-".concat(app.name);
Object.keys(mappedState).forEach(function (key) {
computed[key] = function () {
return this[dataKey][key];
};
});
return {
data: function () {
var _a;
var result = (_a = {},
_a[dataKey] = mappedState,
_a);
return result;
},
computed: computed,
created: function () {
var _this = this;
unwatchState = app.watchState(mapStateToComputed).do(function (value) {
_this[dataKey] = value;
});
},
beforeDestroy: function () {
unwatchState();
},
beforeUnmount: function () {
unwatchState();
}
};
}; };
var eventsMixin = function (app) { return function (events) {
var offEvents = null;
return {
methods: events,
created: function () {
var _this = this;
var _events = {};
Object.entries(events).forEach(function (_a) {
var key = _a[0], Fn = _a[1];
_events[key] = Fn.bind(_this);
});
offEvents = app.listenEvents(_events);
},
beforeDestroy: function () {
offEvents();
},
beforeUnmount: function () {
offEvents();
}
};
}; };
var methodsMixin = function (app) { return function (methods) {
var offMethods = null;
return {
methods: methods,
created: function () {
var _this = this;
var _methods = {};
Object.entries(methods).forEach(function (_a) {
var key = _a[0], Fn = _a[1];
_methods[key] = Fn.bind(_this);
});
offMethods = app.addMethods(_methods);
},
beforeDestroy: function () {
offMethods();
},
beforeUnmount: function () {
offMethods();
}
};
}; };
exports.eventsHook = eventsHook;
exports.eventsMixin = eventsMixin;
exports.methodsHook = methodsHook;
exports.methodsMixin = methodsMixin;
exports.stateHook = stateHook;
exports.stateMixin = stateMixin;

@@ -47,0 +126,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

10

package.json
{
"name": "@rallie/vue",
"version": "0.6.0",
"version": "0.6.1",
"description": "vue binding for rallie",

@@ -25,10 +25,10 @@ "author": "runnan <1608272694@qq.com>",

"peerDependencies": {
"rallie": ">=0.5.3",
"rallie": "^0.6.0",
"vue": ">=3.2.6"
},
"devDependencies": {
"@rallie/core": "^0.6.0",
"rallie": "^0.6.0"
"@rallie/core": "^0.6.1",
"rallie": "^0.6.1"
},
"gitHead": "8be5247aeedca969023dd6d3854b4075abc614a1"
"gitHead": "97ad8a63ef22f61aeb42404288da57c00b3f0cd3"
}
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