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

@onflow/config

Package Overview
Dependencies
Maintainers
7
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onflow/config - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

4

CHANGELOG.md

@@ -5,4 +5,8 @@ ### Unreleased

### 0.0.2 -- 2020-08-13
2020-08-13 -- `@onflow/util-actor` VSN `0.0.1` -> `0.0.2`
### 0.0.1 -- 2020-07-17
- 2020-07-17 -- Initial Implementation

2

dist/config.js

@@ -1,2 +0,2 @@

var n=require("@onflow/util-actor");const t=function(){function n(){}return n.prototype.then=function(t,r){const o=new n,i=this.s;if(i){const n=1&i?t:r;if(n){try{e(o,1,n(this.v))}catch(n){e(o,2,n)}return o}return this}return this.o=function(n){try{const i=n.v;1&n.s?e(o,1,t?t(i):i):r?e(o,1,r(i)):e(o,2,i)}catch(n){e(o,2,n)}},o},n}();function e(n,r,o){if(!n.s){if(o instanceof t){if(!o.s)return void(o.o=e.bind(null,n,r));1&r&&(r=o.s),o=o.v}if(o&&o.then)return void o.then(e.bind(null,n,r),e.bind(null,n,2));n.s=r,n.v=o;const i=n.o;i&&i(n)}}function r(n){return n instanceof t&&1&n.s}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var o,i="config",u="PUT_CONFIG",f="GET_CONFIG",c="CONFIG/UPDATED",s=function(n){return n},a=((o={})[u]=function(n,t,e){var r=e.key,o=e.value;if(null==r)throw new Error("Missing 'key' for config/put.");n.put(r,o),n.broadcast(c,n.all())},o[f]=function(n,t,e){var r=e.key,o=e.fallback;if(null==r)throw new Error("Missing 'key' for config/get");t.reply(n.get(r,o))},o.UPDATE_CONFIG=function(n,t,e){var r=e.key,o=e.fn;if(null==r)throw new Error("Missing 'key' for config/update");n.update(r,o||s),n.broadcast(c,n.all())},o.DELETE_CONFIG=function(n,t,e){var r=e.key;if(null==r)throw new Error("Missing 'key' for config/delete");n.delete(r),n.broadcast(c,n.all())},o.WHERE_CONFIG=function(n,t,e){var r=e.pattern;if(null==r)throw new Error("Missing 'pattern' for config/where");t.reply(n.where(r))},o[n.SUBSCRIBE]=function(n,t){n.subscribe(t.from),n.send(t.from,c,n.all())},o[n.UNSUBSCRIBE]=function(n,t){n.unsubscribe(t.from)},o);function l(t,e){return n.send(i,u,{key:t,value:e}),E()}function d(t,e){return n.send(i,f,{key:t,fallback:e},{expectReply:!0,timeout:10})}function h(t,e){return void 0===e&&(e=s),n.send(i,"UPDATE_CONFIG",{key:t,fn:e}),E()}function v(t){return n.send(i,"DELETE_CONFIG",{key:t}),E()}function y(t){return n.send(i,"WHERE_CONFIG",{pattern:t},{expectReply:!0,timeout:10})}function b(o){var u=n.spawn(function(u){try{var f=!1;return u.send(i,n.SUBSCRIBE),Promise.resolve(function(n,o,i){for(var u;;){var f=n();if(r(f)&&(f=f.v),!f)return c;if(f.then){u=0;break}var c=i();if(c&&c.then){if(!r(c)){u=1;break}c=c.s}}var s=new t,a=e.bind(null,s,2);return(0===u?f.then(d):1===u?c.then(l):(void 0).then(function(){(f=n())?f.then?f.then(d).then(void 0,a):d(f):e(s,1,c)})).then(void 0,a),s;function l(t){c=t;do{if(!(f=n())||r(f)&&!f.v)return void e(s,1,c);if(f.then)return void f.then(d).then(void 0,a);r(c=i())&&(c=c.v)}while(!c||!c.then);c.then(l).then(void 0,a)}function d(n){n?(c=i())&&c.then?c.then(l).then(void 0,a):l(c):e(s,1,c)}}(function(){return!f&&1},0,function(){return Promise.resolve(u.receive()).then(function(t){if("@EXIT"===t.tag)return u.send(i,n.UNSUBSCRIBE),void(f=!0);o(t.data)})}))}catch(n){return Promise.reject(n)}});return function(){return n.send(u,"@EXIT")}}function E(){return{put:l,get:d,update:h,delete:v,where:y,subscribe:b}}n.spawn(a,i),exports.config=E;
var n,e=require("@onflow/util-actor"),r="config",t="PUT_CONFIG",o="GET_CONFIG",i="CONFIG/UPDATED",u=function(n){return n},f=((n={})[t]=function(n,e,r){var t=r.key,o=r.value;if(null==t)throw new Error("Missing 'key' for config/put.");n.put(t,o),n.broadcast(i,n.all())},n[o]=function(n,e,r){var t=r.key,o=r.fallback;if(null==t)throw new Error("Missing 'key' for config/get");e.reply(n.get(t,o))},n.UPDATE_CONFIG=function(n,e,r){var t=r.key,o=r.fn;if(null==t)throw new Error("Missing 'key' for config/update");n.update(t,o||u),n.broadcast(i,n.all())},n.DELETE_CONFIG=function(n,e,r){var t=r.key;if(null==t)throw new Error("Missing 'key' for config/delete");n.delete(t),n.broadcast(i,n.all())},n.WHERE_CONFIG=function(n,e,r){var t=r.pattern;if(null==t)throw new Error("Missing 'pattern' for config/where");e.reply(n.where(t))},n[e.SUBSCRIBE]=function(n,e){n.subscribe(e.from),n.send(e.from,i,n.all())},n[e.UNSUBSCRIBE]=function(n,e){n.unsubscribe(e.from)},n);function c(n,o){return e.send(r,t,{key:n,value:o}),d()}function l(n,t){return e.send(r,o,{key:n,fallback:t},{expectReply:!0,timeout:10})}function a(n,t){return void 0===t&&(t=u),e.send(r,"UPDATE_CONFIG",{key:n,fn:t}),d()}function s(n){return e.send(r,"DELETE_CONFIG",{key:n}),d()}function E(n){return e.send(r,"WHERE_CONFIG",{pattern:n},{expectReply:!0,timeout:10})}function p(n){return e.subscriber(r,function(){return e.spawn(f,r)},n)}function d(){return{put:c,get:l,update:a,delete:s,where:E,subscribe:p}}e.spawn(f,r),exports.config=d;
//# sourceMappingURL=config.js.map

@@ -1,2 +0,2 @@

import{SUBSCRIBE as n,UNSUBSCRIBE as t,spawn as e,send as r}from"@onflow/util-actor";const o=function(){function n(){}return n.prototype.then=function(t,e){const r=new n,o=this.s;if(o){const n=1&o?t:e;if(n){try{i(r,1,n(this.v))}catch(n){i(r,2,n)}return r}return this}return this.o=function(n){try{const o=n.v;1&n.s?i(r,1,t?t(o):o):e?i(r,1,e(o)):i(r,2,o)}catch(n){i(r,2,n)}},r},n}();function i(n,t,e){if(!n.s){if(e instanceof o){if(!e.s)return void(e.o=i.bind(null,n,t));1&t&&(t=e.s),e=e.v}if(e&&e.then)return void e.then(i.bind(null,n,t),i.bind(null,n,2));n.s=t,n.v=e;const r=n.o;r&&r(n)}}function u(n){return n instanceof o&&1&n.s}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var f,c="config",a="PUT_CONFIG",l="GET_CONFIG",s="CONFIG/UPDATED",h=function(n){return n},v=((f={})[a]=function(n,t,e){var r=e.key,o=e.value;if(null==r)throw new Error("Missing 'key' for config/put.");n.put(r,o),n.broadcast(s,n.all())},f[l]=function(n,t,e){var r=e.key,o=e.fallback;if(null==r)throw new Error("Missing 'key' for config/get");t.reply(n.get(r,o))},f.UPDATE_CONFIG=function(n,t,e){var r=e.key,o=e.fn;if(null==r)throw new Error("Missing 'key' for config/update");n.update(r,o||h),n.broadcast(s,n.all())},f.DELETE_CONFIG=function(n,t,e){var r=e.key;if(null==r)throw new Error("Missing 'key' for config/delete");n.delete(r),n.broadcast(s,n.all())},f.WHERE_CONFIG=function(n,t,e){var r=e.pattern;if(null==r)throw new Error("Missing 'pattern' for config/where");t.reply(n.where(r))},f[n]=function(n,t){n.subscribe(t.from),n.send(t.from,s,n.all())},f[t]=function(n,t){n.unsubscribe(t.from)},f);function y(n,t){return r(c,a,{key:n,value:t}),w()}function d(n,t){return r(c,l,{key:n,fallback:t},{expectReply:!0,timeout:10})}function b(n,t){return void 0===t&&(t=h),r(c,"UPDATE_CONFIG",{key:n,fn:t}),w()}function p(n){return r(c,"DELETE_CONFIG",{key:n}),w()}function E(n){return r(c,"WHERE_CONFIG",{pattern:n},{expectReply:!0,timeout:10})}function m(f){var a=e(function(e){try{var r=!1;return e.send(c,n),Promise.resolve(function(n,t,e){for(var r;;){var f=n();if(u(f)&&(f=f.v),!f)return c;if(f.then){r=0;break}var c=e();if(c&&c.then){if(!u(c)){r=1;break}c=c.s}}var a=new o,l=i.bind(null,a,2);return(0===r?f.then(h):1===r?c.then(s):(void 0).then(function(){(f=n())?f.then?f.then(h).then(void 0,l):h(f):i(a,1,c)})).then(void 0,l),a;function s(t){c=t;do{if(!(f=n())||u(f)&&!f.v)return void i(a,1,c);if(f.then)return void f.then(h).then(void 0,l);u(c=e())&&(c=c.v)}while(!c||!c.then);c.then(s).then(void 0,l)}function h(n){n?(c=e())&&c.then?c.then(s).then(void 0,l):s(c):i(a,1,c)}}(function(){return!r&&1},0,function(){return Promise.resolve(e.receive()).then(function(n){if("@EXIT"===n.tag)return e.send(c,t),void(r=!0);f(n.data)})}))}catch(n){return Promise.reject(n)}});return function(){return r(a,"@EXIT")}}function w(){return{put:y,get:d,update:b,delete:p,where:E,subscribe:m}}e(v,c);export{w as config};
import{spawn as e,SUBSCRIBE as r,UNSUBSCRIBE as n,send as t,subscriber as o}from"@onflow/util-actor";const i="config",u="PUT_CONFIG",l="GET_CONFIG",f="CONFIG/UPDATED",c=e=>e,a={[u]:(e,r,{key:n,value:t})=>{if(null==n)throw new Error("Missing 'key' for config/put.");e.put(n,t),e.broadcast(f,e.all())},[l]:(e,r,{key:n,fallback:t})=>{if(null==n)throw new Error("Missing 'key' for config/get");r.reply(e.get(n,t))},UPDATE_CONFIG:(e,r,{key:n,fn:t})=>{if(null==n)throw new Error("Missing 'key' for config/update");e.update(n,t||c),e.broadcast(f,e.all())},DELETE_CONFIG:(e,r,{key:n})=>{if(null==n)throw new Error("Missing 'key' for config/delete");e.delete(n),e.broadcast(f,e.all())},WHERE_CONFIG:(e,r,{pattern:n})=>{if(null==n)throw new Error("Missing 'pattern' for config/where");r.reply(e.where(n))},[r]:(e,r)=>{e.subscribe(r.from),e.send(r.from,f,e.all())},[n]:(e,r)=>{e.unsubscribe(r.from)}};function s(e,r){return t(i,u,{key:e,value:r}),w()}function E(e,r){return t(i,l,{key:e,fallback:r},{expectReply:!0,timeout:10})}function p(e,r=c){return t(i,"UPDATE_CONFIG",{key:e,fn:r}),w()}function y(e){return t(i,"DELETE_CONFIG",{key:e}),w()}function g(e){return t(i,"WHERE_CONFIG",{pattern:e},{expectReply:!0,timeout:10})}function k(r){return o(i,()=>e(a,i),r)}function w(){return{put:s,get:E,update:p,delete:y,where:g,subscribe:k}}e(a,i);export{w as config};
//# sourceMappingURL=config.modern.js.map

@@ -1,2 +0,2 @@

import{SUBSCRIBE as n,UNSUBSCRIBE as t,spawn as e,send as r}from"@onflow/util-actor";const o=function(){function n(){}return n.prototype.then=function(t,e){const r=new n,o=this.s;if(o){const n=1&o?t:e;if(n){try{i(r,1,n(this.v))}catch(n){i(r,2,n)}return r}return this}return this.o=function(n){try{const o=n.v;1&n.s?i(r,1,t?t(o):o):e?i(r,1,e(o)):i(r,2,o)}catch(n){i(r,2,n)}},r},n}();function i(n,t,e){if(!n.s){if(e instanceof o){if(!e.s)return void(e.o=i.bind(null,n,t));1&t&&(t=e.s),e=e.v}if(e&&e.then)return void e.then(i.bind(null,n,t),i.bind(null,n,2));n.s=t,n.v=e;const r=n.o;r&&r(n)}}function u(n){return n instanceof o&&1&n.s}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var f,c="config",a="PUT_CONFIG",l="GET_CONFIG",s="CONFIG/UPDATED",h=function(n){return n},v=((f={})[a]=function(n,t,e){var r=e.key,o=e.value;if(null==r)throw new Error("Missing 'key' for config/put.");n.put(r,o),n.broadcast(s,n.all())},f[l]=function(n,t,e){var r=e.key,o=e.fallback;if(null==r)throw new Error("Missing 'key' for config/get");t.reply(n.get(r,o))},f.UPDATE_CONFIG=function(n,t,e){var r=e.key,o=e.fn;if(null==r)throw new Error("Missing 'key' for config/update");n.update(r,o||h),n.broadcast(s,n.all())},f.DELETE_CONFIG=function(n,t,e){var r=e.key;if(null==r)throw new Error("Missing 'key' for config/delete");n.delete(r),n.broadcast(s,n.all())},f.WHERE_CONFIG=function(n,t,e){var r=e.pattern;if(null==r)throw new Error("Missing 'pattern' for config/where");t.reply(n.where(r))},f[n]=function(n,t){n.subscribe(t.from),n.send(t.from,s,n.all())},f[t]=function(n,t){n.unsubscribe(t.from)},f);function y(n,t){return r(c,a,{key:n,value:t}),w()}function d(n,t){return r(c,l,{key:n,fallback:t},{expectReply:!0,timeout:10})}function b(n,t){return void 0===t&&(t=h),r(c,"UPDATE_CONFIG",{key:n,fn:t}),w()}function p(n){return r(c,"DELETE_CONFIG",{key:n}),w()}function E(n){return r(c,"WHERE_CONFIG",{pattern:n},{expectReply:!0,timeout:10})}function m(f){var a=e(function(e){try{var r=!1;return e.send(c,n),Promise.resolve(function(n,t,e){for(var r;;){var f=n();if(u(f)&&(f=f.v),!f)return c;if(f.then){r=0;break}var c=e();if(c&&c.then){if(!u(c)){r=1;break}c=c.s}}var a=new o,l=i.bind(null,a,2);return(0===r?f.then(h):1===r?c.then(s):(void 0).then(function(){(f=n())?f.then?f.then(h).then(void 0,l):h(f):i(a,1,c)})).then(void 0,l),a;function s(t){c=t;do{if(!(f=n())||u(f)&&!f.v)return void i(a,1,c);if(f.then)return void f.then(h).then(void 0,l);u(c=e())&&(c=c.v)}while(!c||!c.then);c.then(s).then(void 0,l)}function h(n){n?(c=e())&&c.then?c.then(s).then(void 0,l):s(c):i(a,1,c)}}(function(){return!r&&1},0,function(){return Promise.resolve(e.receive()).then(function(n){if("@EXIT"===n.tag)return e.send(c,t),void(r=!0);f(n.data)})}))}catch(n){return Promise.reject(n)}});return function(){return r(a,"@EXIT")}}function w(){return{put:y,get:d,update:b,delete:p,where:E,subscribe:m}}e(v,c);export{w as config};
import{SUBSCRIBE as n,UNSUBSCRIBE as r,spawn as e,send as t,subscriber as o}from"@onflow/util-actor";var i,u="config",f="PUT_CONFIG",c="GET_CONFIG",l="CONFIG/UPDATED",a=function(n){return n},s=((i={})[f]=function(n,r,e){var t=e.key,o=e.value;if(null==t)throw new Error("Missing 'key' for config/put.");n.put(t,o),n.broadcast(l,n.all())},i[c]=function(n,r,e){var t=e.key,o=e.fallback;if(null==t)throw new Error("Missing 'key' for config/get");r.reply(n.get(t,o))},i.UPDATE_CONFIG=function(n,r,e){var t=e.key,o=e.fn;if(null==t)throw new Error("Missing 'key' for config/update");n.update(t,o||a),n.broadcast(l,n.all())},i.DELETE_CONFIG=function(n,r,e){var t=e.key;if(null==t)throw new Error("Missing 'key' for config/delete");n.delete(t),n.broadcast(l,n.all())},i.WHERE_CONFIG=function(n,r,e){var t=e.pattern;if(null==t)throw new Error("Missing 'pattern' for config/where");r.reply(n.where(t))},i[n]=function(n,r){n.subscribe(r.from),n.send(r.from,l,n.all())},i[r]=function(n,r){n.unsubscribe(r.from)},i);function E(n,r){return t(u,f,{key:n,value:r}),b()}function p(n,r){return t(u,c,{key:n,fallback:r},{expectReply:!0,timeout:10})}function y(n,r){return void 0===r&&(r=a),t(u,"UPDATE_CONFIG",{key:n,fn:r}),b()}function g(n){return t(u,"DELETE_CONFIG",{key:n}),b()}function k(n){return t(u,"WHERE_CONFIG",{pattern:n},{expectReply:!0,timeout:10})}function w(n){return o(u,function(){return e(s,u)},n)}function b(){return{put:E,get:p,update:y,delete:g,where:k,subscribe:w}}e(s,u);export{b as config};
//# sourceMappingURL=config.module.js.map

@@ -1,2 +0,2 @@

!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@onflow/util-actor")):"function"==typeof define&&define.amd?define(["exports","@onflow/util-actor"],e):e((n=n||self).config={},n.utilActor)}(this,function(n,e){const t=function(){function n(){}return n.prototype.then=function(e,t){const o=new n,i=this.s;if(i){const n=1&i?e:t;if(n){try{r(o,1,n(this.v))}catch(n){r(o,2,n)}return o}return this}return this.o=function(n){try{const i=n.v;1&n.s?r(o,1,e?e(i):i):t?r(o,1,t(i)):r(o,2,i)}catch(n){r(o,2,n)}},o},n}();function r(n,e,o){if(!n.s){if(o instanceof t){if(!o.s)return void(o.o=r.bind(null,n,e));1&e&&(e=o.s),o=o.v}if(o&&o.then)return void o.then(r.bind(null,n,e),r.bind(null,n,2));n.s=e,n.v=o;const i=n.o;i&&i(n)}}function o(n){return n instanceof t&&1&n.s}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var i,u="config",f="PUT_CONFIG",c="GET_CONFIG",s="CONFIG/UPDATED",l=function(n){return n},a=((i={})[f]=function(n,e,t){var r=t.key,o=t.value;if(null==r)throw new Error("Missing 'key' for config/put.");n.put(r,o),n.broadcast(s,n.all())},i[c]=function(n,e,t){var r=t.key,o=t.fallback;if(null==r)throw new Error("Missing 'key' for config/get");e.reply(n.get(r,o))},i.UPDATE_CONFIG=function(n,e,t){var r=t.key,o=t.fn;if(null==r)throw new Error("Missing 'key' for config/update");n.update(r,o||l),n.broadcast(s,n.all())},i.DELETE_CONFIG=function(n,e,t){var r=t.key;if(null==r)throw new Error("Missing 'key' for config/delete");n.delete(r),n.broadcast(s,n.all())},i.WHERE_CONFIG=function(n,e,t){var r=t.pattern;if(null==r)throw new Error("Missing 'pattern' for config/where");e.reply(n.where(r))},i[e.SUBSCRIBE]=function(n,e){n.subscribe(e.from),n.send(e.from,s,n.all())},i[e.UNSUBSCRIBE]=function(n,e){n.unsubscribe(e.from)},i);function d(n,t){return e.send(u,f,{key:n,value:t}),E()}function h(n,t){return e.send(u,c,{key:n,fallback:t},{expectReply:!0,timeout:10})}function y(n,t){return void 0===t&&(t=l),e.send(u,"UPDATE_CONFIG",{key:n,fn:t}),E()}function v(n){return e.send(u,"DELETE_CONFIG",{key:n}),E()}function b(n){return e.send(u,"WHERE_CONFIG",{pattern:n},{expectReply:!0,timeout:10})}function p(n){var i=e.spawn(function(i){try{var f=!1;return i.send(u,e.SUBSCRIBE),Promise.resolve(function(n,e,i){for(var u;;){var f=n();if(o(f)&&(f=f.v),!f)return c;if(f.then){u=0;break}var c=i();if(c&&c.then){if(!o(c)){u=1;break}c=c.s}}var s=new t,l=r.bind(null,s,2);return(0===u?f.then(d):1===u?c.then(a):(void 0).then(function(){(f=n())?f.then?f.then(d).then(void 0,l):d(f):r(s,1,c)})).then(void 0,l),s;function a(e){c=e;do{if(!(f=n())||o(f)&&!f.v)return void r(s,1,c);if(f.then)return void f.then(d).then(void 0,l);o(c=i())&&(c=c.v)}while(!c||!c.then);c.then(a).then(void 0,l)}function d(n){n?(c=i())&&c.then?c.then(a).then(void 0,l):a(c):r(s,1,c)}}(function(){return!f&&1},0,function(){return Promise.resolve(i.receive()).then(function(t){if("@EXIT"===t.tag)return i.send(u,e.UNSUBSCRIBE),void(f=!0);n(t.data)})}))}catch(n){return Promise.reject(n)}});return function(){return e.send(i,"@EXIT")}}function E(){return{put:d,get:h,update:y,delete:v,where:b,subscribe:p}}e.spawn(a,u),n.config=E});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@onflow/util-actor")):"function"==typeof define&&define.amd?define(["exports","@onflow/util-actor"],n):n((e=e||self).config={},e.utilActor)}(this,function(e,n){var r,t="config",o="PUT_CONFIG",i="GET_CONFIG",f="CONFIG/UPDATED",u=function(e){return e},c=((r={})[o]=function(e,n,r){var t=r.key,o=r.value;if(null==t)throw new Error("Missing 'key' for config/put.");e.put(t,o),e.broadcast(f,e.all())},r[i]=function(e,n,r){var t=r.key,o=r.fallback;if(null==t)throw new Error("Missing 'key' for config/get");n.reply(e.get(t,o))},r.UPDATE_CONFIG=function(e,n,r){var t=r.key,o=r.fn;if(null==t)throw new Error("Missing 'key' for config/update");e.update(t,o||u),e.broadcast(f,e.all())},r.DELETE_CONFIG=function(e,n,r){var t=r.key;if(null==t)throw new Error("Missing 'key' for config/delete");e.delete(t),e.broadcast(f,e.all())},r.WHERE_CONFIG=function(e,n,r){var t=r.pattern;if(null==t)throw new Error("Missing 'pattern' for config/where");n.reply(e.where(t))},r[n.SUBSCRIBE]=function(e,n){e.subscribe(n.from),e.send(n.from,f,e.all())},r[n.UNSUBSCRIBE]=function(e,n){e.unsubscribe(n.from)},r);function l(e,r){return n.send(t,o,{key:e,value:r}),y()}function s(e,r){return n.send(t,i,{key:e,fallback:r},{expectReply:!0,timeout:10})}function a(e,r){return void 0===r&&(r=u),n.send(t,"UPDATE_CONFIG",{key:e,fn:r}),y()}function d(e){return n.send(t,"DELETE_CONFIG",{key:e}),y()}function p(e){return n.send(t,"WHERE_CONFIG",{pattern:e},{expectReply:!0,timeout:10})}function E(e){return n.subscriber(t,function(){return n.spawn(c,t)},e)}function y(){return{put:l,get:s,update:a,delete:d,where:p,subscribe:E}}n.spawn(c,t),e.config=y});
//# sourceMappingURL=config.umd.js.map
{
"name": "@onflow/config",
"version": "0.0.1",
"version": "0.0.2",
"description": "A mechanism for configuring the Flow JS SDK and FCL",

@@ -21,8 +21,8 @@ "license": "Apache-2.0",

"devDependencies": {
"jest": "25.3.0",
"jest": "26.4.0",
"jest-esm-transformer": "1.0.0",
"microbundle": "0.12.0-next.8"
"microbundle": "0.12.3"
},
"dependencies": {
"@onflow/util-actor": "0.0.1"
"@onflow/util-actor": "0.0.2"
},

@@ -29,0 +29,0 @@ "source": "src/index.js",

@@ -1,2 +0,8 @@

import {spawn, send, SUBSCRIBE, UNSUBSCRIBE} from "@onflow/util-actor"
import {
spawn,
send,
subscriber,
SUBSCRIBE,
UNSUBSCRIBE,
} from "@onflow/util-actor"

@@ -72,15 +78,3 @@ const NAME = "config"

function subscribe(callback) {
const EXIT = "@EXIT"
const self = spawn(async ctx => {
ctx.send(NAME, SUBSCRIBE)
while (1) {
const letter = await ctx.receive()
if (letter.tag === EXIT) {
ctx.send(NAME, UNSUBSCRIBE)
return
}
callback(letter.data)
}
})
return () => send(self, EXIT)
return subscriber(NAME, () => spawn(HANDLERS, NAME), callback)
}

@@ -87,0 +81,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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