docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Subscription<TState, TSelected>

    A subscription to a store for a selected state.

    Inheritance
    object
    SubscriptionBase<IStore<TState>, TState, TSelected>
    Subscription<TState, TSelected>
    Implements
    ISubscription<TState>
    IDisposableSubscription
    IDisposable
    Inherited Members
    SubscriptionBase<IStore<TState>, TState, TSelected>.Dispose()
    SubscriptionBase<IStore<TState>, TState, TSelected>.IsValid()
    SubscriptionBase<IStore<TState>, TState, TSelected>.Unsubscribe()
    SubscriptionBase<IStore<TState>, TState, TSelected>.Notify(TState)
    SubscriptionBase<IStore<TState>, TState, TSelected>.GetStoreState(IStore<TState>)
    SubscriptionBase<IStore<TState>, TState, TSelected>.RemoveFromStore(IStore<TState>)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.Redux
    Assembly: Unity.AppUI.Redux.dll
    Syntax
    public class Subscription<TState, TSelected> : SubscriptionBase<IStore<TState>, TState, TSelected>, ISubscription<TState>, IDisposableSubscription, IDisposable
    Type Parameters
    Name Description
    TState

    The type of the store state.

    TSelected

    The type of the selected state.

    Constructors

    Subscription(Selector<TState, TSelected>, Listener<TSelected>, IStore<TState>, SubscribeOptions<TSelected>)

    Create a new subscription to a store for a selected state.

    Declaration
    public Subscription(Selector<TState, TSelected> selector, Listener<TSelected> listener, IStore<TState> store, SubscribeOptions<TSelected> options)
    Parameters
    Type Name Description
    Selector<TState, TSelected> selector

    The selector to use to select the state.

    Listener<TSelected> listener

    The listener to notify of state changes.

    IStore<TState> store

    The store to subscribe to.

    SubscribeOptions<TSelected> options

    The options for the subscription.

    Methods

    GetStoreState(IStore<TState>)

    Get the state from the store.

    Declaration
    protected override TState GetStoreState(IStore<TState> store)
    Parameters
    Type Name Description
    IStore<TState> store

    The store to get the state from.

    Returns
    Type Description
    TState

    The state from the store.

    Overrides
    SubscriptionBase<IStore<TState>, TState, TSelected>.GetStoreState(IStore<TState>)

    RemoveFromStore(IStore<TState>)

    Remove the subscription from the store.

    Declaration
    protected override bool RemoveFromStore(IStore<TState> store)
    Parameters
    Type Name Description
    IStore<TState> store

    The store to remove the subscription from.

    Returns
    Type Description
    bool

    Whether the subscription was removed.

    Overrides
    SubscriptionBase<IStore<TState>, TState, TSelected>.RemoveFromStore(IStore<TState>)

    Implements

    ISubscription<TState>
    IDisposableSubscription
    IDisposable
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)