@@ -33,6 +33,10 @@ function setAttribute(node, attribute, value) {
33
33
node . setAttribute ( attribute , value ) ;
34
34
}
35
35
36
+ function blankObject ( ) {
37
+ return Object . create ( null ) ;
38
+ }
39
+
36
40
function destroy ( detach ) {
37
41
this . destroy = noop ;
38
42
this . fire ( 'destroy' ) ;
@@ -68,10 +72,6 @@ function dispatchObservers(component, group, changed, newState, oldState) {
68
72
}
69
73
}
70
74
71
- function get ( key ) {
72
- return key ? this . _state [ key ] : this . _state ;
73
- }
74
-
75
75
function fire ( eventName , data ) {
76
76
var handlers =
77
77
eventName in this . _handlers && this . _handlers [ eventName ] . slice ( ) ;
@@ -82,6 +82,20 @@ function fire(eventName, data) {
82
82
}
83
83
}
84
84
85
+ function get ( key ) {
86
+ return key ? this . _state [ key ] : this . _state ;
87
+ }
88
+
89
+ function init ( component , options ) {
90
+ component . options = options ;
91
+
92
+ component . _observers = { pre : blankObject ( ) , post : blankObject ( ) } ;
93
+ component . _handlers = blankObject ( ) ;
94
+ component . _root = options . _root || component ;
95
+ component . _yield = options . _yield ;
96
+ component . _bind = options . _bind ;
97
+ }
98
+
85
99
function observe ( key , callback , options ) {
86
100
var group = options && options . defer
87
101
? this . _observers . post
@@ -171,7 +185,7 @@ var proto = {
171
185
_unmount : _unmount
172
186
} ;
173
187
174
- /* generated by Svelte v1.39.2 */
188
+ /* generated by Svelte v1.39.3 */
175
189
176
190
function encapsulateStyles ( node ) {
177
191
setAttribute ( node , "svelte-2363328337" , "" ) ;
@@ -212,20 +226,9 @@ function create_main_fragment(state, component) {
212
226
}
213
227
214
228
function SvelteComponent ( options ) {
215
- this . options = options ;
229
+ init ( this , options ) ;
216
230
this . _state = options . data || { } ;
217
231
218
- this . _observers = {
219
- pre : Object . create ( null ) ,
220
- post : Object . create ( null )
221
- } ;
222
-
223
- this . _handlers = Object . create ( null ) ;
224
-
225
- this . _root = options . _root || this ;
226
- this . _yield = options . _yield ;
227
- this . _bind = options . _bind ;
228
-
229
232
if ( ! document . getElementById ( "svelte-2363328337-style" ) ) add_css ( ) ;
230
233
231
234
this . _fragment = create_main_fragment ( this . _state , this ) ;
0 commit comments