Lit's reactive properties system allows you to define properties on your custom element that automatically update the element when their values change.
This file contains hidden or 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 { Dispatch, SetStateAction } from "react"; | |
export const removeFromComplexObject = | |
<Value, State extends Record<keyof State, Value[]>>( | |
setState: Dispatch<SetStateAction<State>>, | |
keyName: keyof State | |
) => | |
(filterOption: Value) => | |
setState((currentState) => ({ | |
...currentState, |
This file contains hidden or 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 { useEffect, useState } from 'react'; | |
interface Variables { | |
[variable: string]: string; | |
} | |
const useCSSRootVariable = (variables: Variables): void => { | |
const [styleTag] = useState(() => document.createElement('style')); | |
useEffect(() => { |
This file contains hidden or 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
const whatsDifferent = (old: any, check: any) => Object.entries(old) | |
.filter(entry => entry[1] !== check[entry[0]]) | |
.map(entry => entry[0]); |
This file contains hidden or 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
<html> | |
<head> | |
<title>Playground</title> | |
<style> | |
.hidden { | |
border: 0; | |
clip: rect(0, 0, 0, 0); |
This file contains hidden or 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
.content { | |
max-width: 980px; | |
margin: 0 auto; | |
} | |
@media only screen and (max-width: 1068px) { | |
.content { | |
max-width: 698px; | |
} | |
} |
This file contains hidden or 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
package li.angu.youtube.tutorial.block; | |
import org.bukkit.Material; | |
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* Created by finreinhard on 18.01.17. | |
*/ |
This file contains hidden or 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
package li.angu.youtube.tutorial.actionbar; | |
import net.minecraft.server.v1_8_R3.IChatBaseComponent; | |
import net.minecraft.server.v1_8_R3.PacketPlayOutChat; | |
import org.bukkit.ChatColor; | |
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; | |
import org.bukkit.entity.Player; | |
/** | |
* Created by finreinhard on 04.01.17. |
This file contains hidden or 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
File file = new File("../"); | |
file.delete(); |