Home

react-generic-tools 0.0.121

Project status

npm npm downloads

build build push package

check types lint

deploy web documentation web documentation

Use case

React utilities for simple state caching, types and testing.

Installation

You can install via package manager or simply download the compiled version as zip file here and inject:

npm install react-generic-tools
import {useMemorizedValue, useReferenceState} from 'react-generic-tools'

// ...

Testing example

import {formatEndUserTime} from 'react-generic-tools/endToEndTestHelper'
import {expect, test} from '@playwright/test'

test(
    'Interval can get start and end values via harness.',
    async ({page}) => {
        // given
        await page.goto('/')
        await page.locator('.tab-bar__tap-interval').click()

        // when
        const now = new Date()
        const formattedStartTime = formatEndUserTime(now)

       // ...
    }
)