Meeseeks.select
You're seeing just the function
select
, go back to Meeseeks module for more information.
Specs
select(queryable(), selectors(), Meeseeks.Context.t()) :: any() | {:error, Meeseeks.Error.t()}
Returns the accumulated result of walking the queryable, accumulating nodes
that match a selector. Prefer all
or one
- select
should only be used
when a custom accumulator is required.
Requires that a Meeseeks.Accumulator
has been added to the context via
Meeseeks.Context.add_accumulator/2
, and will raise an error if it hasn't.
Parses the source if it is not a Meeseeks.Document
or Meeseeks.Result
,
and may return {:error, %Meeseeks.Error{type: parser}
if there is a parse
error.
If multiple selections are being ran on the same unparsed source, parse first to avoid unnecessary computation.
Examples
iex> import Meeseeks.CSS
iex> accumulator = %Meeseeks.Accumulator.One{}
iex> context = Meeseeks.Context.add_accumulator(%{}, accumulator)
iex> Meeseeks.select("<div id=main><p>1</p><p>2</p><p>3</p></div>", css("#main p"), context)
#Meeseeks.Result<{ <p>1</p> }>