@forastro/utilities v5.2.2
For Astro Utilities
This package is a set of components and functions that make things easier to accomplish with Astro. It's a library that has functions that are useful for conditional rendering and iteration. It has a link component which is useful for creating links that indicate what page you are on. A component for creating gaps between elements. It even has two components that allow you to reuse markup.
Installation
To install this package npm i @forastro/utilities
Examples
executeIf<T extends ()=> any>(condition: boolean,cb: T): ReturnType<T> | null
 const fruits = ['Apple', 'Strawberry']
 {executeIf(!fruits.includes("Apple"), ()=> 'Not a fruit'))}iterate<T HasForEachMethod | Generator, U>(iterable:T, (value:unknown: info:IterationInfo, key:unknown)=> U):AsyncGenerator
{iterate([1, 2, 3, 4, 5, 6], (value:number, info:IterationInfo) => (
<div style={{backgroundColor: info.isOdd ? 'red': 'blue' }} >
    {value}
</div>
))}function useTemplaterAndProjector<
  ProjectorProps extends Record<string, unknown> | null,
  TemplaterProps extends Record<string, unknown> | null = null,
>(
  debugName?: string,
): [
  Templater<ProjectorProps, TemplaterProps>,
  Projector<TemplaterProps, ProjectorProps>,
];Creating a template
---
 const [RandomStringTemplate, RandomStringProjector] = useTemplaterAndProjector()
---
<RandomStringTemplate>
    I'm content
</RandomStringTemplate><RandomStringProjector/>Docs
Please checkout the docs for For Astro Utilities
Contributions
If you want to contribute to the repo then go to this site
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
9 months ago
5 months ago
5 months ago
5 months ago
10 months ago
10 months ago
5 months ago
5 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago