hashbrown

useJsonParser

Create a prop-driven streaming JSON parser that can optionally resolve values with a Skillet schema.

API

export declare function useJsonParser<
  Schema extends  s.HashbrownType ,
>(
  json: string,
  schema: Schema,
):  UseJsonParserResult <
   s.Infer <Schema>
>;
useJsonParser
UseJsonParserResult<s.Infer<Schema>>
@paramjson:
string

The full JSON string that grows over time.

@paramschema:
Schema

Optional Skillet schema to resolve values from the parser state.

@typeSchema
s.HashbrownType
@returns
UseJsonParserResult<s.Infer<Schema>>