docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface INotifiable<TState>

    Interface for a store that can notify subscribers of state changes.

    Namespace: Unity.AppUI.Redux
    Assembly: Unity.AppUI.Redux.dll
    Syntax
    public interface INotifiable<out TState>
    Type Parameters
    Name Description
    TState

    The type of the store state.

    Methods

    NotifySubscribers()

    Notify the subscribers of a new state.

    Declaration
    void NotifySubscribers()

    Subscribe<TSelected>(Selector<TState, TSelected>, Listener<TSelected>, SubscribeOptions<TSelected>)

    Subscribe to a state change and listen to a specific part of the state.

    Declaration
    IDisposableSubscription Subscribe<TSelected>(Selector<out TState, TSelected> selector, Listener<TSelected> listener, SubscribeOptions<TSelected> options = default)
    Parameters
    Type Name Description
    Selector<TState, TSelected> selector

    The selector to get the selected part of the state.

    Listener<TSelected> listener

    The listener to be invoked on every dispatch.

    SubscribeOptions<TSelected> options

    The options for the subscription.

    Returns
    Type Description
    IDisposableSubscription

    A Subscription object that can be disposed.

    Type Parameters
    Name Description
    TSelected

    The type of the selected part of the state.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the selector or listener is null.

    Unsubscribe(ISubscription<TState>)

    Remove a subscription from the store.

    Declaration
    bool Unsubscribe(ISubscription<out TState> subscription)
    Parameters
    Type Name Description
    ISubscription<TState> subscription

    The subscription to remove.

    Returns
    Type Description
    bool

    True if the subscription was removed, false otherwise.

    Extension Methods

    StoreExtensions.Subscribe<TStoreState>(INotifiable<TStoreState>, Listener<TStoreState>, SubscribeOptions<TStoreState>)
    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)