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

Allow aracari to track changes for batch updates. #14

Open
jcblw opened this issue Nov 26, 2020 · 0 comments
Open

Allow aracari to track changes for batch updates. #14

jcblw opened this issue Nov 26, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jcblw
Copy link
Contributor

jcblw commented Nov 26, 2020

Description

This would allow for more gracefully replacements, so that way we are doing all operations at once on text nodes. This would be great to be able to emulate in a virtual environment as well.

const aracari = new Aracari(parentNode, { batch: true}); // allow for only batch replacements.
console.log(aracari.getText()) // the bird is the word
aracari.replace('bird', [span]);
aracari.replace('word', [span]);

console.log(aracari.changes()) // { replace: 'bird', address: '0' }, { replace: 'word', address: '2' }
// aracari knows the second replacement is at the address of 2 because of the prior replacement. 

aracari.commit(); // not sure what the name should be here.

Working in a virtual env, server, or background script we would need some type of equivalent to create these nodes or maybe another interface?

@jcblw jcblw self-assigned this Nov 26, 2020
@jcblw jcblw added the enhancement New feature or request label Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant