-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d13b3ce
commit c01605b
Showing
32 changed files
with
259 additions
and
194 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
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
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
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
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
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
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,79 @@ | ||
enum Maybe(value) { | ||
Just(value) | ||
Nothing | ||
} | ||
|
||
component Instance { | ||
fun render : Html { | ||
<div as base></div> | ||
} | ||
} | ||
|
||
component Main { | ||
fun handleClick { | ||
case (instance) { | ||
Maybe::Just(component) => component.base | ||
Maybe::Nothing => Maybe::Nothing | ||
} | ||
} | ||
|
||
fun render : Html { | ||
<div onClick={handleClick}> | ||
<Instance as instance/> | ||
</div> | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
import { | ||
patternVariable as L, | ||
createElement as G, | ||
pattern as K, | ||
useMemo as F, | ||
variant as B, | ||
setRef as H, | ||
useRef as E, | ||
match as J | ||
} from "runtime"; | ||
|
||
const | ||
A = B(1), | ||
C = B(0), | ||
D = ({ | ||
_ | ||
}) => { | ||
const a = E(new C()); | ||
const b = F(() => { | ||
return { | ||
a | ||
} | ||
}, []); | ||
(_ ? _(b) : null); | ||
return G(`div`, { | ||
ref: H(a, A) | ||
}) | ||
}, | ||
I = () => { | ||
const | ||
c = E(new C()), | ||
d = () => { | ||
return J(c.current, [ | ||
[ | ||
K(A, [L]), | ||
(e) => { | ||
return e.a.current | ||
} | ||
], | ||
[ | ||
K(C, []), | ||
() => { | ||
return new C() | ||
} | ||
] | ||
]) | ||
}; | ||
return G(`div`, { | ||
"onClick": d | ||
}, [G(D, { | ||
_: H(c, A) | ||
})]) | ||
}; |
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
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
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
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
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
Oops, something went wrong.