If you mean get values from the actual map, then no. Maps and lists are completely different types.
However, you can create an association list that would have the same functionality of the map:
let reviews = [(book1, review1), (book2, review2),...etc];
Because the books are records, you wouldn’t be able to use the (===) function to look them up; you’ll have to provide a custom equality function. That would probably look similar to the comparison function we used in the previous post, but it would have to return a boolean instead of an integer.
Belt.List.getAssoc(reviews, someBook, bookEqualsFn);
/* returns option(review) */
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.