Skip to content

Instantly share code, notes, and snippets.

View patissier-boulanger's full-sized avatar

Juhyoung JUNG patissier-boulanger

View GitHub Profile
import React, {Dispatch, SetStateAction, useEffect, useState} from 'react';
import {Pressable, Text, useWindowDimensions, View} from 'react-native';
import Animated, {
Easing,
runOnJS,
useAnimatedStyle,
useSharedValue,
withSpring,
withTiming,
} from 'react-native-reanimated';
@patissier-boulanger
patissier-boulanger / cache_worker.js
Last active February 16, 2023 08:48
Cache worker
// inside service worker eg. sw.ts
self.addEventListener('fetch', function (event) {
if (event.request.url.endsWith('.mp4')) {
event.respondWith(
caches.match(event.request).then(function (response) {
if (response) {
return response
} else {