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

vue-flow

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-flow - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

2

package.json
{
"name": "vue-flow",
"version": "0.2.2",
"version": "0.2.3",
"description": "To make the state of application managed and processed as data flow.",

@@ -5,0 +5,0 @@ "main": "vue-flow.js",

(function () {
/**
Vue.flow.model()
Vue.flow.addMiddleware()
Vue.flow.mixin()
Vue.flow.bind()
Vue.flow.model()
Vue.flow.addMiddleware()
Vue.flow.mixin()
Vue.flow.bind()
* */

@@ -54,3 +54,3 @@

function dispatch(name, obj) {
function dispatch() {

@@ -84,3 +84,3 @@ return run_middlewares(this, Array.prototype.slice.call(arguments), {

return middlewares[index++](dispatch, next, end, meta).apply(model, args);
else if(args[0] && args[0].constructor === Object) return end(args[0]);
else return end(args[0]);
}

@@ -107,3 +107,3 @@ function end(result){

for (var i = 0, l = pipes.length; i < l; i++) if (pipes) {
for (var i = 0, l = pipes.length; i < l; i++) if (pipes[i]) {
// 第2层根据changedFields判断是否有更新,过滤一把

@@ -144,3 +144,3 @@ if (pipes[i].statePath[1] && changedFields.indexOf(pipes[i].statePath[1]) === -1) continue;

for (var i = 0, l = hook_beforeStore.length; i < l; i++) {
hook_beforeFlowIn[i](comp, meta);
hook_beforeFlowIn[i].call(comp, meta);
}

@@ -153,3 +153,3 @@ }

if (typeof func === 'function')
switch (hookName) {
switch (bindName) {
case 'beforeStore':

@@ -177,5 +177,5 @@ hook_beforeStore.push(func);

init: function () {
if (this.$options.flow) {
for (var x in this.$options.flow) if (this.$options.flow.hasOwnProperty(x)) {
var statePath = this.$options.flow[x].split('.');
if (this.$options.pipes) {
for (var x in this.$options.pipes) if (this.$options.pipes.hasOwnProperty(x)) {
var statePath = this.$options.pipes[x].split('.');
connections[statePath[0]] = connections[statePath[0]] || [];

@@ -193,8 +193,22 @@ connections[statePath[0]].push({

if(this.$options.action){
var action;
for (var x in this.$options.action) if (this.$options.action.hasOwnProperty(x)) {
action = this.$options.action[x].split('.');
if (!models[action[0]]) throw 'the model ' + action[0] + ' is not exist';
if (!models[action[0]][action[1]]) throw 'the action ' + action[1] + ' of model ' + action[0] + ' is not exist';
this[x]=(function(modelName,actionName){
return function(){
models[modelName][actionName].call(models[modelName], Array.prototype.slice.call(arguments));
};
})(action[0], action[1]);
}
}
},
beforeDestroy: function () {
if (this.$options.flow) {
if (this.$options.pipes) {
var statePath, tmp;
for (var x in this.$options.flow) if (this.$options.flow.hasOwnProperty(x)) {
statePath = this.$options.flow[x].split('.');
for (var x in this.$options.pipes) if (this.$options.pipes.hasOwnProperty(x)) {
statePath = this.$options.pipes[x].split('.');
tmp = [];

@@ -273,2 +287,3 @@ for (var i = 0, l = connections[statePath[0]].length; i < l; i++) {

function pathValue(statePath) {
console.log(statePath);
var state = store[statePath[0]];

@@ -275,0 +290,0 @@ if (!statePath[1]) return clone(state);

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