View context.jsx
import React from "react"; | |
const MyContext = React.createContext(); | |
const MyProvider = ({ children }) => { | |
const [theme, setTheme] = React.useState("light"); | |
const nextTheme = theme === "light" ? "dark" : "light"; | |
const value = { | |
theme, |
View ImageTools.es6
let hasBlobConstructor = typeof(Blob) !== 'undefined' && (function () { | |
try { | |
return Boolean(new Blob()); | |
} catch (e) { | |
return false; | |
} | |
}()); | |
let hasArrayBufferViewSupport = hasBlobConstructor && typeof(Uint8Array) !== 'undefined' && (function () { | |
try { |