Very good to know. Thanks a lot...
You write: "Later I will show you another way of handling this."
What another way to start a value, using the same example with array?
I probably meant that instead of plain observables it's sometimes more convenient to use Rx subjects as you can define them with default values, in this case an empty array, like new BehaviorSubject([]) that also can act as an observable. This way it won't blow up when you subscribe and try to loop over it in Svelte since initial value is an empty array and not null. You can however achieve same thing with RxJS startWith([]) operator and plain observables too if you want.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Very good to know. Thanks a lot...
You write: "Later I will show you another way of handling this."
What another way to start a value, using the same example with array?
I probably meant that instead of plain observables it's sometimes more convenient to use Rx subjects as you can define them with default values, in this case an empty array, like
new BehaviorSubject([])
that also can act as an observable. This way it won't blow up when you subscribe and try to loop over it in Svelte since initial value is an empty array and not null. You can however achieve same thing with RxJS startWith([]) operator and plain observables too if you want.