Module

Next.GetServerSideProps

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

#ServerSidePropsContext Source

type ServerSidePropsContext :: Row Type -> Typetype ServerSidePropsContext params = { defaultLocale :: Maybe Locale, locale :: Maybe Locale, locales :: Maybe (Array Locale), params :: Maybe (Record params), preview :: Maybe Boolean, query :: Object String, req :: Foreign, res :: Foreign, resolvedUrl :: String }

#ServerSideProps Source

type ServerSideProps :: Type -> Row Typetype ServerSideProps props = (notFound :: Boolean, props :: props, redirect :: { destination :: String, permanent :: Boolean })

#GetServerSideProps Source

#toGetServerSideProps Source

toGetServerSideProps :: forall partialProps componentProps params. (EffectFn1 Foreign (Promise partialProps)) -> GetServerSideProps params componentProps

#decodeContextOrCrash Source

#mkGetServerSideProps Source

mkGetServerSideProps :: forall props p p_ params. Union p p_ (ServerSideProps props) => ReadForeign (Record params) => ReadForeign (Record p) => WriteForeign props => WriteForeign { props :: { serialisedProps :: String } | p } => (ServerSidePropsContext params -> Aff { props :: props | p }) -> GetServerSideProps (Record params) (SerialisedProps props)