How to use the @reactorx/core.AsyncStage.STARTED function in @reactorx/core

To help you get started, we’ve selected a few @reactorx/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github querycap / reactorx / @reactorx / request / src / useRequesting$.ts View on Github external
(counts, actor: any) => {
          const parentActorType = actor.opts.parentActor.type;

          const count = counts[parentActorType] || 0;

          if (actor.stage === AsyncStage.STARTED) {
            return {
              ...counts,
              [parentActorType]: count + 1,
            };
          }

          if (count > 1) {
            return {
              ...counts,
              [parentActorType]: count - 1,
            };
          }

          return omit(counts, parentActorType);
        },
        {} as Dictionary,