Ok Max, thanks I'll give it a go and see how it works out.
On Monday, October 24, 2016 at 4:13:33 PM UTC+2, Max Goldstein wrote:
>
> If you're going to refer to items by ID a lot, you should probably use a
> dictionary keyed on ID. Assuming items is a record with an id field:
>
> { model |
>
If you're going to refer to items by ID a lot, you should probably use a
dictionary keyed on ID. Assuming items is a record with an id field:
{ model |
items = model.items |> Dict.insert updatedItem.id updatedItem }
--
You received this message because you are subscribed to the Google
| The names were inspired by Dict.insert and Dict.update, which were the
closest to what I was looking for.
Yeah, I'm probably just too used to that dot notation.
I don't know why but
items.replaceItemById id item
looks better than
replaceItemById items id item
. Somehow it feels like a
Op maandag 24 oktober 2016 13:18:59 UTC+2 schreef Lars Jacobsson:
>
> Any thinking going out there on around naming conventions OOP vs
> functional? I'd be grateful for any input on this matter of life or death!
>
I always try to keep my naming conventions close to the Core functions.
E.g. in my