Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.119
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
html_old /
iNetty /
node_modules /
preact /
src /
Delete
Unzip
Name
Size
Permission
Date
Action
diff
[ DIR ]
drwxr-xr-x
2022-04-21 14:33
cjs.js
115
B
-rw-r--r--
2022-04-21 14:29
clone-element.js
983
B
-rw-r--r--
2022-04-21 14:29
component.js
6.81
KB
-rw-r--r--
2022-04-21 14:29
constants.js
161
B
-rw-r--r--
2022-04-21 14:29
create-context.js
2.11
KB
-rw-r--r--
2022-04-21 14:29
create-element.js
3.01
KB
-rw-r--r--
2022-04-21 14:29
index.d.ts
8.22
KB
-rw-r--r--
2022-04-21 14:29
index.js
391
B
-rw-r--r--
2022-04-21 14:29
internal.d.ts
4.91
KB
-rw-r--r--
2022-04-21 14:29
jsx.d.ts
31.81
KB
-rw-r--r--
2022-04-21 14:29
options.js
587
B
-rw-r--r--
2022-04-21 14:29
render.js
2.43
KB
-rw-r--r--
2022-04-21 14:29
util.js
850
B
-rw-r--r--
2022-04-21 14:29
Save
Rename
import { enqueueRender } from './component'; export let i = 0; export function createContext(defaultValue, contextId) { contextId = '__cC' + i++; const context = { _id: contextId, _defaultValue: defaultValue, /** @type {import('./internal').FunctionComponent} */ Consumer(props, contextValue) { // return props.children( // context[contextId] ? context[contextId].props.value : defaultValue // ); return props.children(contextValue); }, /** @type {import('./internal').FunctionComponent} */ Provider(props) { if (!this.getChildContext) { let subs = []; let ctx = {}; ctx[contextId] = this; this.getChildContext = () => ctx; this.shouldComponentUpdate = function(_props) { if (this.props.value !== _props.value) { // I think the forced value propagation here was only needed when `options.debounceRendering` was being bypassed: // https://github.com/preactjs/preact/commit/4d339fb803bea09e9f198abf38ca1bf8ea4b7771#diff-54682ce380935a717e41b8bfc54737f6R358 // In those cases though, even with the value corrected, we're double-rendering all nodes. // It might be better to just tell folks not to use force-sync mode. // Currently, using `useContext()` in a class component will overwrite its `this.context` value. // subs.some(c => { // c.context = _props.value; // enqueueRender(c); // }); // subs.some(c => { // c.context[contextId] = _props.value; // enqueueRender(c); // }); subs.some(enqueueRender); } }; this.sub = c => { subs.push(c); let old = c.componentWillUnmount; c.componentWillUnmount = () => { subs.splice(subs.indexOf(c), 1); if (old) old.call(c); }; }; } return props.children; } }; // Devtools needs access to the context object when it // encounters a Provider. This is necessary to support // setting `displayName` on the context object instead // of on the component itself. See: // https://reactjs.org/docs/context.html#contextdisplayname return (context.Provider._contextRef = context.Consumer.contextType = context); }