Skip to content

Instantly share code, notes, and snippets.

View FocusThen's full-sized avatar
🦄
Everyting is JavaScript

M. Mücahit Tezcan FocusThen

🦄
Everyting is JavaScript
View GitHub Profile
@themarcba
themarcba / vuejs-like-mini-framework.html
Created May 23, 2020 12:24
This is the click counter example for a blog post I wrote about creating your own mini-Vue.js. https://marc.dev/blog/vue-from-scratch-part-5
<style>
* {
user-select: none;
}
body {
margin: 0;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
#app {
height: 100vh;
@themarcba
themarcba / vuejs-like-reactive-state.html
Last active February 5, 2024 11:52
Vue.js-like reactive state
<script>
let activeEffect
class Dep {
subscribers = new Set()
depend() {
if (activeEffect) this.subscribers.add(activeEffect)
}
notify() {
this.subscribers.forEach((sub) => sub())
@themarcba
themarcba / vuejs-like-dependency.html
Last active February 5, 2024 11:51
Vue.js-like Reactive Dependency
<script>
let activeEffect
class Dep {
// Initialize the value of the reactive dependency
constructor(value) {
this._value = value
this.subscribers = new Set()
}
@themarcba
themarcba / vdom-finished.html
Last active April 20, 2024 03:37
Vue.js-like Virtual DOM
<div id="app"></div>
<script>
// Create virtual node
function h(tag, props, children) {
// Return the virtual node
return {
tag,
props,
children,
}
@akella
akella / setup.md
Last active May 1, 2024 05:33
My Setup