Skip to content

Instantly share code, notes, and snippets.

@talentdeficit
Last active August 29, 2015 14:01
Show Gist options
  • Save talentdeficit/14c1a5427e8d9b36385f to your computer and use it in GitHub Desktop.
Save talentdeficit/14c1a5427e8d9b36385f to your computer and use it in GitHub Desktop.
jsex incomplete api
{:incomplete, continue} = JSEX.decode("{", [:stream])
# {:incomplete, #Function<1.1670240/1 in :jsx_decoder.incomplete/6>}
{:incomplete, continue} = continue.("}")
# {:incomplete, #Function<1.1670240/1 in :jsx_decoder.incomplete/6>}
continue.(:end_stream)
# {:ok, %{}}
{:incomplete, fragment} = JSEX.decode("{", [:stream])
# {:incomplete, {...}}
{:incomplete, fragment} = JSEX.decode("}", fragment)
# {:incomplete, {...}}
JSEX.decode(:end_stream, fragment)
# {:ok, %{}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment