Skip to content

Instantly share code, notes, and snippets.

View codrin-iftimie's full-sized avatar

Codrin Iftimie codrin-iftimie

View GitHub Profile
@ericwooley
ericwooley / eventEmitterPattern.tsx
Last active March 19, 2021 07:25
How to make eventemitter3 typesafe
import EventEMitter3 from 'eventemitter3'
interface EmitterEvent<Type extends string> extends Object {
type: Type;
}
interface AEvent extends EmitterEvent<'a'>{
aOnly: true
}
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active March 27, 2024 06:09
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

var Bar1 = base => class extends base {
componentWillMount(){
super.componentWillMount();
console.log('Bar1');
}
};
var Bar2 = base => class extends base {
componentWillMount(){
super.componentWillMount();