Skip to content

Commit

Permalink
add helper
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoventurini committed May 13, 2024
1 parent 75221de commit a8edea4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/meteor/asl-helpers-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ Meteor.isFibersDisabled = true;
Meteor._isPromise = function (r) {
return r && typeof r.then === "function";
};

Meteor._runFresh = function (fn) {
return fn();
};
6 changes: 6 additions & 0 deletions packages/meteor/asl-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@ function updateAslStore(key, value) {
return getAslStore()[key] = value;
}

function runFresh(fn) {
var asyncLocalStorage = getAsl();
return asyncLocalStorage.run({}, fn);
}

Meteor._getAsl = getAsl;
Meteor._getAslStore = getAslStore;
Meteor._getValueFromAslStore = getValueFromAslStore;
Meteor._updateAslStore = updateAslStore;
Meteor._runFresh = runFresh;

Meteor._runAsync = function (fn, ctx, store) {
if (store === undefined) {
Expand Down

0 comments on commit a8edea4

Please sign in to comment.