patronum
patronum copied to clipboard
remap with null handling
interface Value {
foo: number | null;
bar?: string;
}
const $demo = createStore<Value | null>(null);
const [$foo, $bar] = remap($demo, ["foo", "bar"]);
// type: [Store<number | null>, Store<string | null>]
const $justFoo = remap($demo, "foo");
// type: Store<number | null>
Alternative names?
-
rechain