Comparing version 0.0.188 to 0.0.189
@@ -1458,4 +1458,11 @@ (function (global, factory) { | ||
ignoreNotification = true; | ||
write($$1(f)); | ||
return lastGet = ourStream($$1()(read())[0]); | ||
write(function (state) { | ||
var newState = $$1(function (target) { | ||
lastGet = f(target); | ||
return lastGet; | ||
})(state); | ||
return newState; | ||
}); | ||
ourStream(lastGet); | ||
return lastGet; | ||
}; | ||
@@ -1468,3 +1475,11 @@ | ||
var get = function get() { | ||
return [read()].map($$1()).map(function (results) { | ||
if (!lastGet) { | ||
computeGet(); | ||
} | ||
return lastGet; | ||
}; | ||
var computeGet = function computeGet() { | ||
[read()].map($$1()).map(function (results) { | ||
if (results.length) { | ||
@@ -1480,2 +1495,3 @@ // async redraw can mean a view is using Z.get() | ||
}).shift(); | ||
ourStream(lastGet); | ||
}; | ||
@@ -1485,3 +1501,3 @@ | ||
if (!ignoreNotification) { | ||
ourStream(get()); | ||
computeGet(); | ||
} | ||
@@ -1527,2 +1543,16 @@ | ||
function mutate(f) { | ||
f(lastGet); // notify | ||
write(function () { | ||
return read(); | ||
}); | ||
return lastGet; | ||
} | ||
function mutateSilent(f) { | ||
f(lastGet); | ||
return lastGet; | ||
} | ||
var others = { | ||
@@ -1534,2 +1564,4 @@ "delete": remove, | ||
throttled: throttled, | ||
mutate: mutate, | ||
mutateSilent: mutateSilent, | ||
filter: function filter(f) { | ||
@@ -1536,0 +1568,0 @@ return query(function (x) { |
{ | ||
"name": "attain", | ||
"version": "0.0.188", | ||
"version": "0.0.189", | ||
"description": "A library for modelling and accessing data.", | ||
@@ -5,0 +5,0 @@ "main": "dist/attain.min.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
690882
6713