w does not support null values

This issue has been tracked since 2022-11-19.

Consider the following modified example from arrow-js.com:

import { r, w } from "@arrow-js/core";

type Data = {
	price: number | null;
	quantity: number;
	logTotal: boolean;
};

const data = r<Data>({
	price: null,
	quantity: 10,
	logTotal: true,
});

function total() {
	if (data.logTotal && data.price !== null) {
		console.log(`Total: ${data.price * data.quantity}`);
	}
}

w(total);

data.price = 35;

Executing the above yields:

TypeError: null is not an object (evaluating 'e.$on')

justin-schroeder wrote this answer on 2022-11-19

Yea — shouldn't act that way.

RafalKornel wrote this answer on 2022-11-19

Fixed in #14

justin-schroeder wrote this answer on 2022-11-22

This should be fixed now in alpha.2

More Details About Repo
Owner Name justin-schroeder
Repo Name arrow-js
Full Name justin-schroeder/arrow-js
Language TypeScript
Created Date 2022-11-08
Updated Date 2023-03-25
Star Count 1238
Watcher Count 21
Fork Count 22
Issue Count 7

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date