Skipping Initialization Value in SubscriptionRef Changes Subscription
Hello. Please tell me how can I subscribe to SubscriptionRef changes and skip the initialization value?
Example:
Example:
const program = Effect.gen(function* ($) {
const ref = yield* $(SubscriptionRef.make(0));
yield* $(
ref.changes.pipe(Stream.tap(Console.log), Stream.runDrain, Effect.fork),
);
yield* $(Effect.sleep(Duration.seconds(1)));
yield* $(SubscriptionRef.update(ref, () => 10));
yield* $(Effect.sleep(Duration.seconds(1)));
yield* $(SubscriptionRef.update(ref, () => 100));
});
Effect.runPromise(program);
// Console:
// 0 - how it skip?
// 10 - ok
// 100 - ok