(initialState?: STATE)
| 20 | * @public |
| 21 | */ |
| 22 | export const createSignal: UseSignal = <STATE>(initialState?: STATE): Signal<STATE> => { |
| 23 | const containerState = useContainerState(); |
| 24 | const value = |
| 25 | isFunction(initialState) && !isQwikComponent(initialState) |
| 26 | ? invoke(undefined, initialState as any) |
| 27 | : initialState; |
| 28 | return _createSignal(value, containerState, 0) as Signal<STATE>; |
| 29 | }; |
| 30 | |
| 31 | /** |
| 32 | * Stores a value which is retained for the lifetime of the component. |
no test coverage detected
searching dependent graphs…