Skip to content

Commit 11baf98

Browse files
committed
0.2.3: implement awful hack to work around sveltejs/svelte#4899
Without this, unpredictable crashes may occur in seemingly random places. This will be reverted as soon as sveltejs/svelte#4909 is merged.
1 parent cabb1c5 commit 11baf98

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 0.2.3
4+
- Implement hack to work around sveltejs/svelte#4899
5+
36
## 0.2.2
47
- Support `Tracker.autorun()` inside `onMount()`
58

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
name: 'rdb:svelte-meteor-data',
3-
version: '0.2.2',
3+
version: '0.2.3',
44
summary: 'Reactively track Meteor data inside Svelte components',
55
git: 'https://github.com/rdb/svelte-meteor-data',
66
documentation: 'README.md'

subscribe.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@
44
* - Makes the return value usable in {#await} blocks
55
*/
66

7-
import { current_component } from 'svelte/internal';
7+
import { current_component, set_current_component, tick } from 'svelte/internal';
8+
9+
10+
const promise = tick();
11+
const oldThen = promise.then;
12+
promise.then = function (fn) {
13+
oldThen.call(promise, () => {
14+
fn();
15+
set_current_component(null);
16+
});
17+
};
818

919
_subscribe = Meteor.subscribe;
1020
Meteor.subscribe = function subscribe(name) {

0 commit comments

Comments
 (0)