From 102c9c2e3be3f5efc0e5a7e3dc162a2a35828b3f Mon Sep 17 00:00:00 2001 From: Abhay Sehgal <30596329+Abhay2012@users.noreply.github.com> Date: Mon, 14 Mar 2022 21:59:50 +0530 Subject: [PATCH] Update README.md Added syntax of replace functionality of append and appendCurrent --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index d6f4f4b8..cbbe7217 100644 --- a/README.md +++ b/README.md @@ -342,6 +342,22 @@ tribute.append(2, [ This will append the new values to the third collection. +You can replace data as well by passing true in second parameter of `appendCurrent` and in third parameter of `append`. + +```js +tribute.appendCurrent([ + { name: "Howard Johnson", occupation: "Panda Wrangler", age: 27 }, + { name: "Fluffy Croutons", occupation: "Crouton Fluffer", age: 32 } +], true); +``` + +```js +tribute.append(2, [ + { name: "Howard Johnson", occupation: "Panda Wrangler", age: 27 }, + { name: "Fluffy Croutons", occupation: "Crouton Fluffer", age: 32 } +], true); +``` + ### Programmatically detecting an active Tribute dropdown If you need to know when Tribute is active you can access the `isActive` property of an instance.