feat: rename helpers to define (#2453)
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { asset } from "@fresh/core/runtime";
|
||||
import { df } from "../utils/state.ts";
|
||||
|
||||
export default df.definePage(function App({ Component, state, url }) {
|
||||
export default df.page(function App({ Component, state, url }) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
@@ -14,7 +14,7 @@ import { SocialProof } from "../components/homepage/SocialProof.tsx";
|
||||
import { DenoSection } from "../components/homepage/DenoSection.tsx";
|
||||
import { df } from "../utils/state.ts";
|
||||
|
||||
export const handler = df.defineHandlers({
|
||||
export const handler = df.handlers({
|
||||
GET(ctx) {
|
||||
const { req } = ctx;
|
||||
const accept = req.headers.get("accept");
|
||||
|
||||
@@ -9,7 +9,7 @@ import { df } from "../utils/state.ts";
|
||||
const TITLE = "Showcase | Fresh";
|
||||
const DESCRIPTION = "Selection of projects that have been built with Fresh.";
|
||||
|
||||
export const handler = df.defineHandlers({
|
||||
export const handler = df.handlers({
|
||||
GET(ctx) {
|
||||
ctx.state.title = TITLE;
|
||||
ctx.state.description = DESCRIPTION;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { PageSection } from "../components/PageSection.tsx";
|
||||
import { DemoBox } from "../components/homepage/DemoBox.tsx";
|
||||
import { df } from "../utils/state.ts";
|
||||
|
||||
export const handler = df.defineHandlers({
|
||||
export const handler = df.handlers({
|
||||
GET(ctx) {
|
||||
const url = new URL(ctx.req.url);
|
||||
const search = new URLSearchParams(url.search);
|
||||
@@ -11,7 +11,7 @@ export const handler = df.defineHandlers({
|
||||
},
|
||||
});
|
||||
|
||||
export default df.definePage<typeof handler>(function ThanksForSubscribing(
|
||||
export default df.page<typeof handler>(function ThanksForSubscribing(
|
||||
props,
|
||||
) {
|
||||
const vote = props?.data?.vote ? props.data.vote.replaceAll(/-/g, " ") : null;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { createHelpers } from "@fresh/core";
|
||||
import { createDefine } from "@fresh/core";
|
||||
|
||||
export interface State {
|
||||
title?: string;
|
||||
@@ -7,4 +7,4 @@ export interface State {
|
||||
noIndex?: boolean;
|
||||
}
|
||||
|
||||
export const df = createHelpers<State>();
|
||||
export const df = createDefine<State>();
|
||||
|
||||
Reference in New Issue
Block a user