tinejs
TypeScript icon, indicating that this package has built-in type declarations

0.1.42 • Public • Published

tinejs

edge framework for nextJs

example:

useCases/hello/index.ts

import { z } from 'zod';
import { tineVar, tineInput, shape } from 'tinejs';

const input = tineInput(z.object({ name: z.string().nullable() }));

const hello = shape({
  params: tineVar(input, ({ name }) => `Hello ${name || 'World'}`)
});

export default hello.withInput(input);

usage:

'use client';

import useSWR from 'swr';
import { UseCases } from '@/useCases';

export default function Page() {
  const { data } = useSWR(...UseCases.hello.input({ name: 'Earth' }));

  return <pre>{JSON.stringify(data, null, '\t')}</pre>;
}

Readme

Keywords

none

Package Sidebar

Install

npm i tinejs

Weekly Downloads

136

Version

0.1.42

License

MIT

Unpacked Size

75.1 kB

Total Files

10

Last publish

Collaborators

  • bersen0