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
import { throttle } from '@solid-primitives/scheduled' | |
import { | |
splitProps, | |
createSignal, | |
createEffect, | |
onCleanup, | |
JSXElement, | |
type Component, | |
type ComponentProps, | |
children, |
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
<div class="container"> | |
<aside id="sidebar"></aside> | |
<div class="resize-handle--x" id="resize-handle" data-target="aside"></div> | |
<main></main> | |
</div> |
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
[ignore] | |
.*/node_modules/fbjs/.* | |
[options] | |
esproposal.class_static_fields=enable | |
esproposal.class_instance_fields=enable | |
[untyped] | |
.*/node_modules/.* |
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
/** | |
* @param {string} eventType | |
* @param {string} selector | |
* @param {function} callback | |
*/ | |
function on(eventType, selector, callback) { | |
document.body.addEventListener(eventType, function (event) { | |
if (event.target.matches(selector)) { | |
callback.call(event.target); | |
} |
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
function trashCSSLoader(url) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', url, true); | |
xhr.onload = function (response) {; | |
applyCSS(response.target.responseText); | |
}; | |
xhr.send(); | |
} | |
function applyCSS(css) { | |
var styles = document.createElement('style'); |
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
class ControlledInputWithInternalState extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
isValid : true, | |
value : props.value | |
}; | |
} | |
Note: This post is a summary of information paraphrased from an excellent blog post by Christian Sepulveda.
Create the app and download the necessary dependencies.
A Pen by Barrett Sonntag on CodePen.
NewerOlder