emadhegab / mhnetwork Goto Github PK
View Code? Open in Web Editor NEWSay goodbye to the Fat ugly singleton Network Manager with this Network Layer
License: MIT License
Say goodbye to the Fat ugly singleton Network Manager with this Network Layer
License: MIT License
Readme:
case .error(_, let networkError):
https://github.com/emadhegab/MHNetwork/blob/master/MHNetworkTests/NetworkDispatcherTest.swift
case .error(let error):
And the last one is compileable only
execute
missed "c" button in protocol declaration so class which implements this protocol should use the same mistaken name
Currently I try to connect to API with GET
requests. The problem is when I get an error I don't see the final request URL - it is hidden somewhere inside this library.
What about to add some log (at least for visible url part)?
I could inherit from NetworkDispatcher
but:
Cannot inherit from non-open class 'NetworkDispatcher' outside of its defining module
[!] Error installing MHNetwork
[!] /usr/bin/git clone https://github.com/emadhegab/MHNetwork.git /var/folders/sy/4_wxmzmj75j733p9k30rms7d7rjblp/T/d20191121-37386-1mduuyp --template= --single-branch --depth 1 --branch 1.1
Cloning into '/var/folders/sy/4_wxmzmj75j733p9k30rms7d7rjblp/T/d20191121-37386-1mduuyp'...
warning: Could not find remote branch 1.1 to clone.
fatal: Remote branch 1.1 not found in upstream origin
return URLQueryItem(name: element.key, value: element.value as? String)
This allows to pass string params only. But if you replace element.value as? String
with \(element.value)
it will accept for example int and bool values too.
Additionally NetworkDispatcher
is protected from inheritance and I should create a copy of it
For example I need a library to collect rss from different websites. I need to specify single url only and get/post method only for each website. You library requires to setup all params even if they are not necessary
For example in your code with getMoviesList
I want to pass an additional param - "year".
I send the same requests but with different year value specified from outside.
How to implement it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.