@rnw-community/shared

v2.2.0

Published

Shared useful utils and types

Readme

Shared

Generic types, type guards and utilities commonly used across packages.

npm version npm downloads

Type guards

Convenient TypeScript type guards for everyday usage.

These type guards make your code more explicit, readable, and type-safe — both at runtime and in TypeScript's flow analysis.

Utils

Utility functions that helps with everyday tasks:

  • getErrorMessage - Get typesafe Error object message.
  • emptyFn - Useful default react prop callback value.
  • cs - Conditional styling util.
  • getDefined - Get fallback value if passed variable is not defined.
  • wait - Promise-based sleep via setTimeout.

Types

Commonly used typescript types:

License

This library is licensed under The MIT License.