- 
  Notifications
 You must be signed in to change notification settings 
- Fork 0
Commit 226c21f
authored
Show created notes on the main page (#7)
* Create notes dependning on the number of created notes
This implementation adds several methods to the Database handler class:
* GetNumberOfNotes - returns the number of notes already created by the
 user in the system. It considers only the size of the repository,
 without checking the correctness of the IDs.
* DoesIDExists - checks whether the notes with the given ID exists in
 the Database
* GetAllNotes - alternate version of creating the notes keys' method.
 It returns the array of already created objects containing the Key and
 it's value.
 This is experimental and not yet fully tested/supported.
Note that the `GetNumberOfNotes` method uses Promise instead of return
callback. This is due to the fact of async nature of native modules. So
to avoid losing the information of returned value when going out of the
return handler, the promise is used which carries the result.
* Go the main page when entering the app
* Overload the CRUD operations for index
The index can now be used as a parameter for all the CRUD operations
done on the Repository.
This is to allow the easier manipulations when it comes to all notes no
matter if they Id matches the db position.
The purpose of this implementation is to make sure that in the future
the index and the ID will be separate and the logic behind
adding/removing and displaying the content will be more flexible.
* Use Promise instead of callback for the Database
The Database native module has all the methods returning values used
asynchronously, but their results are considered as states on the JS
side.
To avoid loosing the data the Promise has been used to make the database
pull more dynamic.
* Pull title and short message when creating note widget
* Use Hooks in NoteWidget1 parent c86c89f commit 226c21f
File tree
6 files changed
+124
-41
lines changed- src- Widgets
 
- windows/ReactNativeNotes- NativeModules- Repository
 
 
6 files changed
+124
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
|  | |||
| 5 | 5 |  | |
| 6 | 6 |  | |
| 7 | 7 |  | |
| 8 | + | ||
| 8 | 9 |  | |
| 9 | 10 |  | |
| 10 | 11 |  | |
| 12 | + | ||
| 11 | 13 |  | |
| 12 | 14 |  | |
| 13 | 15 |  | |
|  | |||
| 23 | 25 |  | |
| 24 | 26 |  | |
| 25 | 27 |  | |
| 26 | - | ||
| 28 | + | ||
| 27 | 29 |  | |
| 28 | 30 |  | |
| 29 | 31 |  | |
| 30 | 32 |  | |
| 31 | 33 |  | |
| 32 | 34 |  | |
| 33 | - | ||
| 35 | + | ||
| 34 | 36 |  | |
| 35 | 37 |  | |
| 36 | 38 |  | |
| 37 | 39 |  | |
| 38 | 40 |  | |
| 39 | 41 |  | |
| 40 | 42 |  | |
| 43 | + | ||
| 41 | 44 |  | |
| 42 | 45 |  | |
| 43 | 46 |  | |
| 44 | 47 |  | |
| 45 | 48 |  | |
| 46 | 49 |  | |
| 47 | 50 |  | |
| 51 | + | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + | ||
| 55 | + | ||
| 56 | + | ||
| 57 | + | ||
| 58 | + | ||
| 59 | + | ||
| 60 | + | ||
| 61 | + | ||
| 62 | + | ||
| 63 | + | ||
| 64 | + | ||
| 65 | + | ||
| 48 | 66 |  | |
| 49 | 67 |  | |
| 50 | 68 |  | |
| 51 | 69 |  | |
| 52 | 70 |  | |
| 53 | 71 |  | |
| 54 | 72 |  | |
| 55 | - | ||
| 73 | + | ||
| 56 | 74 |  | |
| 57 | 75 |  | |
| 58 | 76 |  | |
|  | |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
|  | |||
| 3 | 3 |  | |
| 4 | 4 |  | |
| 5 | 5 |  | |
| 6 | - | ||
| 6 | + | ||
| 7 | 7 |  | |
| 8 | 8 |  | |
| 9 | 9 |  | |
| 10 | 10 |  | |
| 11 | 11 |  | |
| 12 | 12 |  | |
| 13 | 13 |  | |
| 14 | + | ||
| 14 | 15 |  | |
| 15 | 16 |  | |
| 16 | 17 |  | |
| 17 | - | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - | ||
| 21 | - | ||
| 22 | - | ||
| 23 | - | ||
| 24 | - | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + | ||
| 27 | + | ||
| 25 | 28 |  | |
| 26 | - | ||
| 27 | - | ||
| 29 | + | ||
| 30 | + | ||
| 28 | 31 |  | |
| 29 | 32 |  | |
| 30 | - | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - | ||
| 34 | 33 |  | |
| 35 | - | ||
| 36 | - | ||
| 37 | - | ||
| 38 | - | ||
| 39 | - | ||
| 40 | - | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + | ||
| 44 | + | ||
| 41 | 45 |  | |
| 42 | - | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + | ||
| 43 | 49 |  | |
| 44 | - | ||
| 45 | - | ||
| 46 | - | ||
| 47 | - | ||
| 50 | + | ||
| 51 | + | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + | ||
| 48 | 55 |  | |
| 49 | - | ||
| 50 | 56 |  | |
| 57 | + | ||
| 58 | + | ||
| 59 | + | ||
| 51 | 60 |  | |
| 61 | + | ||
| 62 | + | ||
| 63 | + | ||
| 64 | + | ||
| 52 | 65 |  | |
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 66 | + | ||
| 67 | + | ||
| 68 | + | ||
| 69 | + | ||
| 56 | 70 |  | |
| 57 | 71 |  | |
| 58 | 72 |  | |
| 73 | + | ||
| 59 | 74 |  | |
| 60 | 75 |  | |
| 61 | 76 |  | |
|  | |||
| 95 | 110 |  | |
| 96 | 111 |  | |
| 97 | 112 |  | |
| 98 | - | ||
|  | |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
|  | |||
| 53 | 53 |  | |
| 54 | 54 |  | |
| 55 | 55 |  | |
| 56 | - | ||
| 56 | + | ||
| 57 | 57 |  | |
| 58 | 58 |  | |
| 59 | 59 |  | |
|  | |||
Lines changed: 30 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
|  | |||
| 24 | 24 |  | |
| 25 | 25 |  | |
| 26 | 26 |  | |
| 27 | - | ||
| 27 | + | ||
| 28 | 28 |  | |
| 29 | - | ||
| 29 | + | ||
| 30 | 30 |  | |
| 31 | 31 |  | |
| 32 | 32 |  | |
| 33 | - | ||
| 33 | + | ||
| 34 | 34 |  | |
| 35 | - | ||
| 35 | + | ||
| 36 | 36 |  | |
| 37 | 37 |  | |
| 38 | 38 |  | |
| 39 | - | ||
| 39 | + | ||
| 40 | 40 |  | |
| 41 | - | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + | ||
| 44 | + | ||
| 45 | + | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + | ||
| 49 | + | ||
| 50 | + | ||
| 51 | + | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + | ||
| 55 | + | ||
| 56 | + | ||
| 57 | + | ||
| 58 | + | ||
| 59 | + | ||
| 60 | + | ||
| 61 | + | ||
| 62 | + | ||
| 63 | + | ||
| 64 | + | ||
| 65 | + | ||
| 42 | 66 |  | |
| 43 | 67 |  | |
| 44 | 68 |  | |
|  | |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
|  | |||
| 20 | 20 |  | |
| 21 | 21 |  | |
| 22 | 22 |  | |
| 23 | + | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + | ||
| 27 | + | ||
| 28 | + | ||
| 29 | + | ||
| 30 | + | ||
| 23 | 31 |  | |
| 24 | 32 |  | |
| 25 | 33 |  | |
|  | |||
| 36 | 44 |  | |
| 37 | 45 |  | |
| 38 | 46 |  | |
| 47 | + | ||
| 48 | + | ||
| 49 | + | ||
| 50 | + | ||
| 51 | + | ||
| 39 | 52 |  | |
| 40 | 53 |  | |
| 41 | 54 |  | |
| 42 | 55 |  | |
| 56 | + | ||
| 57 | + | ||
| 58 | + | ||
| 59 | + | ||
| 60 | + | ||
| 61 | + | ||
| 62 | + | ||
| 63 | + | ||
| 64 | + | ||
| 43 | 65 |  | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
|  | |||
| 19 | 19 |  | |
| 20 | 20 |  | |
| 21 | 21 |  | |
| 22 | + | ||
| 22 | 23 |  | |
| 23 | 24 |  | |
| 24 | 25 |  | |
| 25 | 26 |  | |
| 27 | + | ||
| 26 | 28 |  | |
| 27 | 29 |  | |
| 28 | 30 |  | |
| 31 | + | ||
| 32 | + | ||
| 33 | + | ||
| 29 | 34 |  | |
| 30 | 35 |  | |
| 31 | 36 |  | |
|  | |||
0 commit comments