您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
UMD of @mantine/store
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/499643/1405080/%40mantine_store-umd.js
- // ==UserScript==
- // @name @mantine_store-umd
- // @namespace flomk.userscripts
- // @version 1.0
- // @description UMD of @mantine/store
- // @author flomk
- // ==/UserScript==
- (function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
- typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MantineStore = {}, global.React));
- })(this, (function (exports, react) { 'use strict';
- function createStore(initialState) {
- let state = initialState;
- let initialized = false;
- const listeners = /* @__PURE__ */ new Set();
- return {
- getState() {
- return state;
- },
- updateState(value) {
- state = typeof value === "function" ? value(state) : value;
- },
- setState(value) {
- this.updateState(value);
- listeners.forEach((listener) => listener(state));
- },
- initialize(value) {
- if (!initialized) {
- state = value;
- initialized = true;
- }
- },
- subscribe(callback) {
- listeners.add(callback);
- return () => listeners.delete(callback);
- }
- };
- }
- function useStore(store) {
- return react.useSyncExternalStore(
- store.subscribe,
- () => store.getState(),
- () => store.getState()
- );
- }
- exports.createStore = createStore;
- exports.useStore = useStore;
- }));
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址