matthewharwood / morningharwood-client

0 stars 0 forks source link

Refactor combo-directive to take all keyEvents from users. #15

Open matthewharwood opened 7 years ago

matthewharwood commented 7 years ago

from "what if the konami code could change my website" to "what if I had a bunch of combos" to "what if all user input flow'd through the same function/service

matthewharwood commented 7 years ago

RawkStar: that fromEvent creates a stream of inputs RawkStar: and I make a sliding window of a buffer of 11 and it emits after 11 every key stroke RawkStar: I can subscribe to that emittion and loop through the keys. "every" will return a boolean if the inner function is true for all cases RawkStar: loop through all the keyEvents** RawkStar: but that litterally is a one off RawkStar: and doesnt account for time RawkStar: the prob is that konami[i] RawkStar: that needs to not be an array of values, nor a table/map of key values RawkStar: but rather a single tree that it traverses

matthewharwood commented 7 years ago

This is called a LinkedHashMap