You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/spacepen.md
+3-2
Original file line number
Diff line number
Diff line change
@@ -3,5 +3,6 @@ Official docs : https://github.com/atom/space-pen / http://atom.github.io/space-
3
3
4
4
## Gotchas
5
5
6
-
* outlet does not work on root. `this` is the root jq element
7
-
*`initialize` is called after the view is attached to the DOM
6
+
* The `outlet` option does not work on root. `this` is the root jq element
7
+
*`initialize` is called after the view is attached to the DOM. The body of the `constructor` executes *after*`initialize` gets called (due to `super()`) so you cannot do `public something` as an argument to constructor. Our workaround is to have an `init` function called from the base view *after* the call to space-pen's `super`. So `init` is where we have the dom available in the clients. There is no point in having a `constructor` in your view
8
+
* Tip: You generally want views to be singletons and *not* take options. So don't have an `init` function. I just did it during exploration.
0 commit comments