Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for slice #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

kriskowal
Copy link
Member

No description provided.

@kriskowal
Copy link
Member Author

@aadsm, would you mind taking on the reivew+merge/maybe?

@aadsm
Copy link
Collaborator

aadsm commented Jun 3, 2014

What are the nuances / caveats on array.slice?

@kriskowal
Copy link
Member Author

@aadsm,

 +The behavior for strings is unimaginative.
 +If the source string, or either the start index or end index changes, the target
 +will be replaced with that slice of the source.
 +
 +The behavior for arrays is nuanced.
 +To avoid these nuances, you should generally use the `view(start, length)`
 +operator directly.
 +It is better suited for viewing a sliding window of an array, allowing
 +the position and size of the window to change orthogonally.
 +
 +However, if you happen to use the `slice` operator on an array, you can expect
 +it to deviate from the norm.
 +Most FRB operators that produce arrays will only emit that array once, even if
 +the value of the input changes.
 +This is beneficial because one can attach change listeners once to an output
 +array knowing that these change listeners will continue to react until the
 +binding is canceled, even if the input temporarily null or is replaced.
 +Because the `slice` operator may have either a string or an array as its input,
 +the output value will change if ever the input value is replaced and may switch
 +between being an array or string depending on the input type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants