Skip to content

Commit 83a4b82

Browse files
megothArne Hassel
authored andcommitted
Work in progress - surplus
Taking surplus for a spin - seems very easy to make use of, I like it!
1 parent 3b65e9a commit 83a4b82

7 files changed

Lines changed: 1464 additions & 4154 deletions

File tree

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ if (typeof window !== 'undefined') {
4747

4848
let register = panes.register
4949

50+
register(require('./markdown/index.tsx').Pane)
51+
5052
register(require('issue-pane'))
5153
register(require('contacts-pane'))
5254

markdown/index.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import * as Surplus from 'surplus'
2+
import { PaneDefinition } from '../types'
3+
// import data from 'surplus-mixin-data'
4+
5+
const { S } = Surplus
6+
7+
export const Pane: PaneDefinition = {
8+
icon: 'crazy/url/icon.svg',
9+
name: 'MarkdownPane',
10+
label: () => 'Handle markdown file',
11+
render: (_subject: any, dom: HTMLDocument) => {
12+
let counter = 0
13+
let counterData = S.data(counter)
14+
const incr = () => {
15+
counter++
16+
counterData(counter)
17+
console.log(counter, counterData())
18+
}
19+
return <div>
20+
test --- <span>{counterData}</span>
21+
<button onClick={incr}>Increment counter</button>
22+
</div>
23+
}
24+
}

0 commit comments

Comments
 (0)