[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
(no description)
File Size: | 2507 lines (102 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
PropSignal:: (6 methods):
store()
isNonDefaultDirectiveSuffix()
isDefaultDirectiveSuffix()
deepClone()
toVdom()
walk()
Class: PropSignal - X-Ref
Structure that manages reactivity for a property in a state object. It usesstore(namespace, {state = {},...block} = {}, {lock = false} = {}) X-Ref |
No description |
isNonDefaultDirectiveSuffix(entry) X-Ref |
No description |
isDefaultDirectiveSuffix(entry) X-Ref |
No description |
deepClone(source) X-Ref |
Recursively clone the passed object. return: Cloned object. param: source Source object. |
toVdom(root) X-Ref |
Recursive function that transforms a DOM tree into vDOM. return: The resulting vDOM tree. param: root The root element or node to start traversing on. |
walk(node) X-Ref |
No description |
__webpack_require__(moduleId) X-Ref |
No description |
createFlusher(compute, notify) X-Ref |
Creates a Flusher object that can be used to flush computed values and notify listeners. Using the mangled properties: this.c: this._callback this.x: this._compute https://github.com/preactjs/signals/blob/main/mangle.json return: The Flusher object with `flush` and `dispose` properties. param: compute The function that computes the value to be flushed. param: notify The function that notifies listeners when the value is flushed. |
utils_useSignalEffect(callback) X-Ref |
Custom hook that executes a callback function whenever a signal is triggered. Version of `useSignalEffect` with a `useEffect`-like execution. This hook implementation comes from this PR, but we added short-cirtuiting to avoid infinite loops: https://github.com/preactjs/signals/pull/290 param: callback The callback function to be executed. |
withScope(func) X-Ref |
Returns the passed function wrapped with the current scope so it is accessible whenever the function runs. This is primarily to make the scope available inside hook callbacks. Asynchronous functions should use generators that yield promises instead of awaiting them. See the documentation for details: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#the-store return: The wrapped function. param: func The passed function. |
useWatch(callback) X-Ref |
Accepts a function that contains imperative code which runs whenever any of the accessed _reactive_ properties (e.g., values from the global state or the context) is modified. This hook makes the element's scope available so functions like `getElement()` and `getContext()` can be used inside the passed callback. param: callback The hook callback. |
useInit(callback) X-Ref |
Accepts a function that contains imperative code which runs only after the element's first render, mainly useful for initialization logic. This hook makes the element's scope available so functions like `getElement()` and `getContext()` can be used inside the passed callback. param: callback The hook callback. |
useEffect(callback, inputs) X-Ref |
Accepts a function that contains imperative, possibly effectful code. The effects run after browser paint, without blocking it. This hook is equivalent to Preact's `useEffect` and makes the element's scope available so functions like `getElement()` and `getContext()` can be used inside the passed callback. param: callback Imperative function that can return a cleanup param: inputs If present, effect will only activate if the |
useLayoutEffect(callback, inputs) X-Ref |
Accepts a function that contains imperative, possibly effectful code. Use this to read layout from the DOM and synchronously re-render. This hook is equivalent to Preact's `useLayoutEffect` and makes the element's scope available so functions like `getElement()` and `getContext()` can be used inside the passed callback. param: callback Imperative function that can return a cleanup param: inputs If present, effect will only activate if the |
useCallback(callback, inputs) X-Ref |
Returns a memoized version of the callback that only changes if one of the inputs has changed (using `===`). This hook is equivalent to Preact's `useCallback` and makes the element's scope available so functions like `getElement()` and `getContext()` can be used inside the passed callback. return: The callback function. param: callback Callback function. param: inputs If present, the callback will only be updated if the |
useMemo(factory, inputs) X-Ref |
Pass a factory function and an array of inputs. `useMemo` will only recompute the memoized value when one of the inputs has changed. This hook is equivalent to Preact's `useMemo` and makes the element's scope available so functions like `getElement()` and `getContext()` can be used inside the passed factory function. return: The memoized value. param: factory Factory function that returns that value for memoization. param: inputs If present, the factory will only be run to recompute if |
insert(child, root) X-Ref |
No description |
kebabToCamelCase(str) X-Ref |
Transforms a kebab-case string to camelCase. return: The transformed camelCase string. param: str The kebab-case string to transform to camelCase. |
Generated : Sat Feb 22 08:20:01 2025 | Cross-referenced by PHPXref |