Ammar Aziz
03/25/2026, 11:26 PMchannel.from and channel.of ?Arthur
03/25/2026, 11:58 PMchannel.from would take either a bare list of items e.g. channel.from(1,2,3,4) or a list channel.from([1,2,3,4]) and both of these would return the same channel. channel.of does not flatten the list out into the individual elements (this is done using channel.fromList now).
ch_from_bare = channel.from(1,2,3,4)
ch_from_bare.view{v -> "from_bare:${v}"}
from_bare:1
from_bare:2
from_bare:3
from_bare:4
ch_from_list = channel.from([1,2,3,4])
ch_from_list.view{v -> "from_list:${v}"}
from_list:1
from_list:2
from_list:3
from_list:4
ch_of_bare = channel.of(1,2,3,4)
ch_of_bare.view{v -> "of_bare:${v}"}
of_bare:1
of_bare:2
of_bare:3
of_bare:4
ch_of_list = channel.of([1,2,3,4])
ch_of_list.view{v -> "of_list:${v}"}
of_list:[1, 2, 3, 4]Ammar Aziz
03/30/2026, 12:16 AMchannel.of treats the list as a single element and channel.from iterates through each element of a given list?Arthur
03/30/2026, 12:17 AM