This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get rid of coffeescript, Try to add panel display from go-plus
- Loading branch information
0mkara
committed
Feb 23, 2017
1 parent
27fbc42
commit beeb333
Showing
10 changed files
with
2,044 additions
and
1,032 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** @babel */ | ||
/** @jsx etch.dom */ | ||
|
||
import etch from 'etch' | ||
|
||
/* | ||
Public: Abstract class for handling the initialization | ||
boilerplate of an Etch component. | ||
*/ | ||
export default class EtchComponent { | ||
constructor (props) { | ||
this.props = props | ||
|
||
etch.initialize(this) | ||
EtchComponent.setScheduler(atom.views) | ||
} | ||
|
||
/* | ||
Public: Gets the scheduler Etch uses for coordinating DOM updates. | ||
Returns a {Scheduler} | ||
*/ | ||
static getScheduler () { | ||
return etch.getScheduler() | ||
} | ||
|
||
/* | ||
Public: Sets the scheduler Etch uses for coordinating DOM updates. | ||
* `scheduler` {Scheduler} | ||
*/ | ||
static setScheduler (scheduler) { | ||
etch.setScheduler(scheduler) | ||
} | ||
|
||
/* | ||
Public: Updates the component's properties and re-renders it. Only the | ||
properties you specify in this object will update – any other properties | ||
the component stores will be unaffected. | ||
* `props` an {Object} representing the properties you want to update | ||
*/ | ||
update (props) { | ||
const oldProps = this.props | ||
this.props = Object.assign({}, oldProps, props) | ||
return etch.update(this) | ||
} | ||
|
||
updateSync (props) { | ||
const oldProps = this.props | ||
this.props = Object.assign({}, oldProps, props) | ||
return etch.updateSync(this) | ||
} | ||
|
||
/* | ||
Public: Destroys the component, removing it from the DOM. | ||
*/ | ||
destroy (removeNode = false) { | ||
etch.destroy(this, removeNode) | ||
} | ||
|
||
render () { | ||
throw new Error('Etch components must implement a `render` method') | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.