Creates an endless Stream of the provided value. One use case is zipping with another stream to remember some state.
value
// Find items inside quotesstreamOf('a', '"', 'b', 'c', '"', 'd', '"', 'e', '"', 'f') .zip(same({inQuotes: false})) .peek(([c, st]) => { if (c === '"') st.inQuotes = !st.inQuotes }) .filter(([c, {inQuotes}]) => c !== '"' && inQuotes) .map(([c]) => c) // Unzip state .toArray() // => ['b', 'c', 'e'] Copy
// Find items inside quotesstreamOf('a', '"', 'b', 'c', '"', 'd', '"', 'e', '"', 'f') .zip(same({inQuotes: false})) .peek(([c, st]) => { if (c === '"') st.inQuotes = !st.inQuotes }) .filter(([c, {inQuotes}]) => c !== '"' && inQuotes) .map(([c]) => c) // Unzip state .toArray() // => ['b', 'c', 'e']
Value type
An item to repeat endlessly
An endless stream of the provided value.
Creates an endless Stream of the provided
value. One use case is zipping with another stream to remember some state.