You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new pages regex checks against a key named url to find children. This is fine when using with something like hypha as it defines a url key in each page object. Would be cool to fallback to the page key name somehow if that url is unavailable, but gets a little tricky with how value is continually set as methods are called with function chainability.
Anyway, quick though and dropping here to think about later.
The text was updated successfully, but these errors were encountered:
Yea I was already thinking about this! Using url feels really fragile and would much rather use key. I could see this working a couple ways. Demonstrating here with v psuedo code (imagine this making sense in the context of the class):
Store a reference to the current _key, in addition to _state and _value
functionpage(key){this._key=keythis._value=this._state[key]}functionchildren(){varchildren=// regex using `this._key`returnchildren}
Store an object rather than just the value when looking up a page:
functionpage(key){this._value={[key]: this._state[key]}}functionchildren(){varkey=Object.keys(this._value)[0]varchildren=// regex using `key`returnchildren}
that Object.keys solution seems like a bit of a hack, in that if you run children when not on a page you might get some wild results, but that might be nbd.
The new
pages
regex checks against a key namedurl
to find children. This is fine when using with something likehypha
as it defines aurl
key in each page object. Would be cool to fallback to the page key name somehow if that url is unavailable, but gets a little tricky with howvalue
is continually set as methods are called with function chainability.Anyway, quick though and dropping here to think about later.
The text was updated successfully, but these errors were encountered: