elf-sync-state-yomo 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.cjs +1 -1
  2. package/index.js +1 -1
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  function syncState(a,b){const c={channel:`${a.name}@store`,source:a=>a.asObservable(),preUpdate:a=>a.data,runGuard:()=>"undefined"!=typeof window&&"undefined"!=typeof window.BroadcastChannel},d=Object.assign(Object.assign({},c),b);if(!d.runGuard())return;let e;const f=()=>e.asObservable(),g=a=>{e.next(a);},h=new BroadcastChannel(d.channel);let i=!0,j=null;return null===j&&(e=new rxjs.BehaviorSubject({}),j=new Presence__default["default"]("https://prsc.yomo.dev",{auth:{// Certification Type
14
14
  type:"token",// Api for getting access token
15
- endpoint:"https://ae59-159-146-14-53.ngrok.io/api/presence-auth"}}),j.on("connected",()=>{console.log("Connected to server: ",j.host);})),h.addEventListener("message",b=>{const c=d.preUpdate(b);i=!1,a.update(a=>Object.assign(Object.assign({},a),c));}),j.on("connected",()=>{j.on("updateData",a=>{console.log("data :",a);});}),d.source(a).pipe(rxjs.skip(1),rxjs.distinctUntilChanged(lodashEs.isEqual),rxjs.tap(a=>{i?(h.postMessage(a),console.log("PostMessage: ",a),g(a),j.on("connected",()=>{f().subscribe(a=>{j.send("updateData",a);});})):i=!0;}),rxjs.finalize(()=>h.close())).subscribe(),h}
15
+ endpoint:"https://ae59-159-146-14-53.ngrok.io/api/presence-auth"}}),j.on("connected",()=>{console.log("Connected to server: ",j.host);})),h.addEventListener("message",b=>{const c=d.preUpdate(b);i=!1,a.update(a=>Object.assign(Object.assign({},a),c));}),j.on("connected",()=>{j.on("updateData",a=>{console.log("data :",a);});}),j.on("connected",()=>{f().subscribe(a=>{j.send("updateData",a);});}),d.source(a).pipe(rxjs.skip(1),rxjs.distinctUntilChanged(lodashEs.isEqual),rxjs.tap(a=>{i?(h.postMessage(a),console.log("PostMessage: ",a),g(a)):i=!0;}),rxjs.finalize(()=>h.close())).subscribe(),h}
16
16
 
17
17
  exports.includeKeys = includeKeys;
18
18
  exports.syncState = syncState;
package/index.js CHANGED
@@ -7,6 +7,6 @@ function includeKeys(a){return pipe(map(b=>Object.keys(b).reduce((c,d)=>(a.inclu
7
7
 
8
8
  function syncState(a,b){const c={channel:`${a.name}@store`,source:a=>a.asObservable(),preUpdate:a=>a.data,runGuard:()=>"undefined"!=typeof window&&"undefined"!=typeof window.BroadcastChannel},d=Object.assign(Object.assign({},c),b);if(!d.runGuard())return;let e;const f=()=>e.asObservable(),g=a=>{e.next(a);},h=new BroadcastChannel(d.channel);let i=!0,j=null;return null===j&&(e=new BehaviorSubject({}),j=new Presence("https://prsc.yomo.dev",{auth:{// Certification Type
9
9
  type:"token",// Api for getting access token
10
- endpoint:"https://ae59-159-146-14-53.ngrok.io/api/presence-auth"}}),j.on("connected",()=>{console.log("Connected to server: ",j.host);})),h.addEventListener("message",b=>{const c=d.preUpdate(b);i=!1,a.update(a=>Object.assign(Object.assign({},a),c));}),j.on("connected",()=>{j.on("updateData",a=>{console.log("data :",a);});}),d.source(a).pipe(skip(1),distinctUntilChanged(isEqual),tap(a=>{i?(h.postMessage(a),console.log("PostMessage: ",a),g(a),j.on("connected",()=>{f().subscribe(a=>{j.send("updateData",a);});})):i=!0;}),finalize(()=>h.close())).subscribe(),h}
10
+ endpoint:"https://ae59-159-146-14-53.ngrok.io/api/presence-auth"}}),j.on("connected",()=>{console.log("Connected to server: ",j.host);})),h.addEventListener("message",b=>{const c=d.preUpdate(b);i=!1,a.update(a=>Object.assign(Object.assign({},a),c));}),j.on("connected",()=>{j.on("updateData",a=>{console.log("data :",a);});}),j.on("connected",()=>{f().subscribe(a=>{j.send("updateData",a);});}),d.source(a).pipe(skip(1),distinctUntilChanged(isEqual),tap(a=>{i?(h.postMessage(a),console.log("PostMessage: ",a),g(a)):i=!0;}),finalize(()=>h.close())).subscribe(),h}
11
11
 
12
12
  export { includeKeys, syncState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elf-sync-state-yomo",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Syncs elf store state across tabs",
5
5
  "publishConfig": {
6
6
  "access": "public"