@rnw-community/shared
v2.2.0
Published
Shared useful utils and types
Maintainers
Readme
Shared
Generic types, type guards and utilities commonly used across packages.
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.
- Generic:
- Array:
- String:
- Number:
- Boolean:
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:
- ClassType
- Maybe
- OnEventFn
- EmptyFn
- Enum
- IsNotEmptyArray
- ReadonlyIsNotEmptyArray
- AnyFn
- AbstractConstructor
- MethodDecoratorType
License
This library is licensed under The MIT License.