We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, the only "nullable" types that are supported are objects, since AssemblyScrpit does not natively support "nullable scalar types" (ex: value: boolean | null).
value: boolean | null
In order to support nullable scalar types, a utility class Nullable<T> can be used. An example implementation: https://github.com/polywrap/monorepo/blob/prealpha/packages/wasm/as/assembly/msgpack/Nullable.ts
Nullable<T>
Example usage:
const nullable = Nullable.fromValue<u32>(5); nullable.isNull; // false nullable.value; // 5 nullable.value = 0;
The text was updated successfully, but these errors were encountered:
Should we use Option primitive from the https://github.com/yjhmelody/as-container here?
Option
This is Rust-inspired, has decent test coverage, and also allows references that we don't in the Nullable type.
Sorry, something went wrong.
No branches or pull requests
Currently, the only "nullable" types that are supported are objects, since AssemblyScrpit does not natively support "nullable scalar types" (ex:
value: boolean | null
).In order to support nullable scalar types, a utility class
Nullable<T>
can be used. An example implementation: https://github.com/polywrap/monorepo/blob/prealpha/packages/wasm/as/assembly/msgpack/Nullable.tsExample usage:
The text was updated successfully, but these errors were encountered: