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
Now that we have some fundamentals it would be good to clean up how we do things.
Implement an iterable context, this will hold operations, operations can be async or sync, it is up to the sync implementation to limit to only sync operations
An all operations will be weakly held against a single iterable
Operations must be invoked in order of creation
An iterable context can be marked as a tuple of n size
An iterable context can be marked as pure, this means all operations must be pure, given a value in, the exact same value out.
A pure context can be given factory producing a weak map or any other object with a get and set function.
The weak map type will be WeakMap<Operation, WeakMap<T, R>>, the object implementing get and set would follow this same signature. A get and set function allows for a shallow equals implementation.
In an async context the get and set functions may return a promise
The context should provide a clear function which invokes the map factory and resets the state (this will be useful for view)
When a context is pure and there is a record for the value and operation, the stored value will be used.
A context can be observed directly using Symbol.asyncIterator, each iteration will occur after each operation, the operations iterable will be returned from the iterator
A context can be given an existing state and operation to perform and move forward to that operation
The context will provide a property operations with the type WeakMap<Operation, Operation>
The context will provide a property initialOperation which will be the first operation, and finalOperation being the last
The operations map will be a linked list of operations, with the key as the current operation, and the child being the next, if the operations map doesn't have a key with an operation, it will be equal to finalOperation
An operation can have a return type of:
void
Iterable<T> where T is the value of the next iterable
Any terminating operations must be excluded from the context, for example toArray, drain, reduce, some, and every
The text was updated successfully, but these errors were encountered:
A context must also be chain able, allowing a weak clone of the state, meaning we could probably do with a iterable of all the available operations, the final operation of the previous context will be the first operation of the next
A context could also be swapped into a pure context and swapped back if needed, providing a way to retain values for only a part of the chain
It would be great to have a two step operation cycle, one for sync resolved operations, allowing to skip a single promise on each cycle, and then an async operation queue that will be hit when there are no more sync retrieved operations found
Now that we have some fundamentals it would be good to clean up how we do things.
Implement an iterable context, this will hold operations, operations can be async or sync, it is up to the sync implementation to limit to only sync operations
An all operations will be weakly held against a single iterable
Operations must be invoked in order of creation
An iterable context can be marked as a tuple of n size
An iterable context can be marked as pure, this means all operations must be pure, given a value in, the exact same value out.
A pure context can be given factory producing a weak map or any other object with a get and set function.
The weak map type will be WeakMap<Operation, WeakMap<T, R>>, the object implementing get and set would follow this same signature. A get and set function allows for a shallow equals implementation.
In an async context the get and set functions may return a promise
The context should provide a clear function which invokes the map factory and resets the state (this will be useful for
view
)When a context is pure and there is a record for the value and operation, the stored value will be used.
A context can be observed directly using Symbol.asyncIterator, each iteration will occur after each operation, the operations iterable will be returned from the iterator
A context can be given an existing state and operation to perform and move forward to that operation
The context will provide a property
operations
with the typeWeakMap<Operation, Operation>
The context will provide a property
initialOperation
which will be the first operation, andfinalOperation
being the lastThe operations map will be a linked list of operations, with the key as the current operation, and the child being the next, if the operations map doesn't have a key with an operation, it will be equal to
finalOperation
An operation can have a return type of:
void
Iterable<T>
whereT
is the value of the next iterableAny terminating operations must be excluded from the context, for example toArray, drain, reduce, some, and every
The text was updated successfully, but these errors were encountered: