Skip to content

Commit

Permalink
0.2.3: implement awful hack to work around sveltejs/svelte#4899
Browse files Browse the repository at this point in the history
Without this, unpredictable crashes may occur in seemingly random places.  This will be reverted as soon as sveltejs/svelte#4909 is merged.
  • Loading branch information
rdb committed Jun 26, 2020
1 parent cabb1c5 commit 11baf98
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 0.2.3
- Implement hack to work around sveltejs/svelte#4899

## 0.2.2
- Support `Tracker.autorun()` inside `onMount()`

Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'rdb:svelte-meteor-data',
version: '0.2.2',
version: '0.2.3',
summary: 'Reactively track Meteor data inside Svelte components',
git: 'https://github.com/rdb/svelte-meteor-data',
documentation: 'README.md'
Expand Down
12 changes: 11 additions & 1 deletion subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
* - Makes the return value usable in {#await} blocks
*/

import { current_component } from 'svelte/internal';
import { current_component, set_current_component, tick } from 'svelte/internal';


const promise = tick();
const oldThen = promise.then;
promise.then = function (fn) {
oldThen.call(promise, () => {
fn();
set_current_component(null);
});
};

_subscribe = Meteor.subscribe;
Meteor.subscribe = function subscribe(name) {
Expand Down

0 comments on commit 11baf98

Please sign in to comment.