Skip to content

Commit c3ca1a9

Browse files
committed
Updated readme with another sample
1 parent f947fef commit c3ca1a9

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
# GetSet
22
GetSet is a JavaScript Micro-library for getting and setting things in HTML Elements. Basically, the idea behind this library is to allow the developer to perform a Get and Set operation in one go.
33

4-
# Usage
4+
## Usage
55
---
66

7-
<pre>
8-
<code>
9-
OnYourMarks.GetSet("main-page-heading", "New Heading").Go();
10-
</code>
11-
</pre>
7+
Use-case #1:
8+
9+
```js
10+
OnYourMarks.GetSet("main-page-heading", "New Heading").Go();
11+
```
12+
13+
Use-case #2:
14+
15+
```js
16+
if(OnYourMarks.GetSet("main-page-heading", "New Heading").Go() >= 0)
17+
{
18+
// Success: Do something.
19+
}
20+
else
21+
{
22+
// Failure: Do something else.
23+
}
24+
```
25+
The `Go` function returns `0` if the operation was successful, otherwise, it returns `-1`.

0 commit comments

Comments
 (0)