DEV Community

Discussion on: StateNotifier, ChangeNotifier — Why, When, and How to use them.

Collapse
 
fadel1411 profile image
faddevlab

What does "??" means in
productList: productList ?? _productList,
?

Collapse
 
amitbhandari7777 profile image
Amit Bhandari

In general case
If you pass productList it will be shown
or else _productList will be shown

Collapse
 
danielasaboro profile image
danielAsaboro

I'm sorry I missed this message, I wouldn't have seen it had someone not reply.
i hope their response was helpful.

to add to it:

it's a shorthand ternary operator

productList = productList != null ? productList : _productList;

I hope this helps.
once again, apologies for the late response