JSPM

qwik-saga

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q15381F
  • License MIT

react minimal typesafe state handling even with saga

Package Exports

  • qwik-saga
  • qwik-saga/dist/qwik-saga.cjs.js
  • qwik-saga/dist/qwik-saga.es.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (qwik-saga) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

qwik-saga

saga process flow handling module for qwik based on redux-saga, but I would like a found a much cleaner way.

! under development, just for lock a module name

placeholder code, just for check module development works

this is some real basics array lib, will be removed!!

export type Mapper = <T>(list: T[]) => T[];
export type Picker = <T>(list: T[]) => T;
export type PickerBy = <T>(list: T[], seek: T) => T;
export type Creators = <T>(amount: number, creators: () => T) => T[];

export const rotateList:Mapper = ([first, ...rest]) => [...rest, first];
export const shuffleList:Mapper = list => [...list].sort(() => Math.random() > 0.5 ? 1 : -1);
export const randomPick:Picker = (list) => list[Math.random() * list.length | 0];
export const createList:Creators = (amount, creators) =>
  Array(amount)
    .fill(0)
    .map(() => creators())
  ;
export const nextOf:PickerBy = (list, current) => list[(list.indexOf(current) + 1) % list.length];

Installation

npm add qwik-saga
# or yarn
yarn add qwik-saga
# or pnpm
pnpm add qwik-saga