Savjee / bearclaw

Menubar app to quickly create new notes in Bear
MIT License
65 stars 8 forks source link

Refactor code into more type-safe. #17

Closed ignazioc closed 5 years ago

ignazioc commented 5 years ago

Disclaimer: I'm sorry if this PR is a bit big and also the scope of it is a big vague. As I mention on the issue #16 I would like to add more functionalities to bearclaw but before starting writing new code I wanted to refactor a little bit the existing one, rewriting some components in a way that's more swifty and type safer.

For example is now impossible to generate a BearAction with the wrong set of parameters. This makes the code safer and easier to understand.

Also the generation of the URL, instead of do it manually concatenating string and manually taking care of the encoding I'm using URLComponents and URLQueryItem that solve the same problem in a better way.

Savjee commented 5 years ago

This looks great, thank you!

Do you have more patches coming soon? If so, I'll wait to publish an update until we get more stuff merged in.

ignazioc commented 5 years ago

thanks for the merge. Yes, I plan to push something more in the upcoming days. I think we can postpone the update for a bit.