Skip to content

Derived store function with no arguments is never set #2056

@jacwright

Description

@jacwright

In the following example, the value t is never set, it remains undefined.

import i18next from 'i18next';

export const language = writable(i18next.language || '');
language.subscribe(value => i18next.changeLanguage(value));

// Update the function because internally the language has been updated
export const t = derive([ language ], () => i18next.t.bind(i18next));

The derived function is run, but the value is never set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions