Add a subscriber to dark mode changes and return a function to remove the subscriber

If notifyImmediately is true, the subscriber will be called immediately with the current value

  • Parameters

    • subscriber: (dark: boolean) => void
    • OptionalnotifyImmediately: boolean

    Returns () => void