Transform the items emitted by an Observable by applying a marshaller function (func(interface{}) ([]byte, error)
) to each item.
type customer struct {
ID int `json:"id"`
}
observable := rxgo.Just(
customer{
ID: 1,
},
customer{
ID: 2,
},
)().Marshal(json.Marshal)
Output:
{"id":1}
{"id":2}