Module

Next.GetStaticProps

Package
purescript-nextjs
Repository
rowtype-yoga/purescript-nextjs

#StaticPropsContext Source

type StaticPropsContext :: Row Type -> Row Type -> Typetype StaticPropsContext params props = { defaultLocale :: Maybe Locale, locale :: Maybe Locale, locales :: Maybe (Array Locale), params :: Maybe (Record params), preview :: Maybe Boolean, previewData :: Maybe (Record props) }

#StaticProps Source

type StaticProps :: Type -> Row Typetype StaticProps props = (notFound :: Boolean, props :: props, revalidate :: Seconds)

#GetStaticProps Source

data GetStaticProps t0 t1

#toGetStaticProps Source

toGetStaticProps :: forall partialProps componentProps params. (EffectFn1 Foreign (Promise partialProps)) -> GetStaticProps params componentProps

#decodeContextOrCrash Source

#mkGetStaticProps Source

mkGetStaticProps :: forall props p p_ params. Union p p_ (StaticProps props) => ReadForeign (Record params) => ReadForeign (Record p) => WriteForeign props => WriteForeign { props :: { serialisedProps :: String } | p } => (StaticPropsContext params p -> Aff { props :: props | p }) -> GetStaticProps (Record params) (SerialisedProps props)