patronum icon indicating copy to clipboard operation
patronum copied to clipboard

Add timers api

Open movpushmov opened this issue 1 year ago • 1 comments

Description

Closes #310

Checklist for a new method

  • [x] Create a directory for the new method in the src directory in param-case
  • [x] Place the source code to src/method-name/index.ts in ESModules export in camelCase named export
  • [x] Add tests to src/method-name/method-name.test.ts
  • [x] Add fork tests to src/method-name/method-name.fork.test.ts
  • [x] Add type tests to test-typings/method-name.ts
    • Use // @ts-expect-error to mark expected type error
    • import { expectType } from 'tsd' to check expected return type
  • [x] Add documentation in src/method-name/readme.md
    • Add header Patronum/MethodName
    • Add section with overloads, if have
    • Add Motivation, Formulae, Arguments and Return sections for each overload
    • Add useful examples in Example section for each overload
  • [x] Add section to README.md in the repository root
    • Add method to the table of contents into correct category - [MethodName](#methodname) - description.
    • Add section ## MethodName
    • Add [Method documentation & API](/src/method-name) into section
    • Add simple example

movpushmov avatar Dec 11 '23 12:12 movpushmov

I think about 2 more features:

  1. Add support for SSR (set $timers value from effector provider, but how?)
  2. Maybe add new function now, which don't accept "getNow" prop and returns "now" from $timers.now

movpushmov avatar Dec 11 '23 12:12 movpushmov