Skip to content

refactor(core): Delete createSignalTuple #61907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions goldens/public-api/core/primitives/signals/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ export function createLinkedSignal<S, D>(sourceFn: () => S, computationFn: Compu
// @public
export function createSignal<T>(initialValue: T, equal?: ValueEqualityFn<T>): [SignalGetter<T>, SignalSetter<T>, SignalUpdater<T>];

// @public @deprecated
export function createSignalTuple<T>(initialValue: T, equal?: ValueEqualityFn<T>): [SignalGetter<T>, SignalSetter<T>, SignalUpdater<T>];

// @public (undocumented)
export function createWatch(fn: (onCleanup: WatchCleanupRegisterFn) => void, schedule: (watch: Watch) => void, allowSignalWrites: boolean): Watch;

Expand Down
1 change: 0 additions & 1 deletion packages/core/primitives/signals/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export {
signalGetFn,
signalSetFn,
signalUpdateFn,
createSignalTuple,
} from './src/signal';
export {Watch, WatchCleanupFn, WatchCleanupRegisterFn, createWatch} from './src/watch';
export {setAlternateWeakRefImpl} from './src/weak_ref';
Expand Down
11 changes: 0 additions & 11 deletions packages/core/primitives/signals/src/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,6 @@ export function createSignal<T>(
return [getter, set, update];
}

/**
* Creates a `Signal` getter, setter, and updater function.
* @deprecated use createSignal
*/
export function createSignalTuple<T>(
initialValue: T,
equal?: ValueEqualityFn<T>,
): [SignalGetter<T>, SignalSetter<T>, SignalUpdater<T>] {
return createSignal(initialValue, equal);
}

export function setPostSignalSetFn(fn: ReactiveHookFn | null): ReactiveHookFn | null {
const prev = postSignalSetFn;
postSignalSetFn = fn;
Expand Down
20 changes: 0 additions & 20 deletions packages/core/test/signals/signal_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
ReactiveNode,
setPostProducerCreatedFn,
setPostSignalSetFn,
createSignalTuple,
SIGNAL,
} from '../../primitives/signals';

Expand Down Expand Up @@ -226,22 +225,3 @@ describe('signals', () => {
setPostProducerCreatedFn(prev);
});
});

describe('createSignalTuple', () => {
it('get returns the signal value', () => {
const [get] = createSignalTuple(0);
expect(get()).toBe(0);
});

it('set sets the signal value', () => {
const [get, set] = createSignalTuple(0);
set(1);
expect(get()).toBe(1);
});

it('update updates the values based on the previous value', () => {
const [get, , update] = createSignalTuple(0);
update((prev) => prev + 2);
expect(get()).toBe(2);
});
});
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy