-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
67 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,5 +28,4 @@ namespace $ { | |
} | ||
|
||
$.$mol_notify = $mol_notify_web | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
namespace $ { | ||
// Not needed, just refer to $mol_offline anywhere | ||
// $mol_service.attach($mol_offline) | ||
$.$mol_service.$mol_offline | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace $ { | ||
export class $mol_service_host extends $mol_object { | ||
static in_worker() { return typeof window === 'undefined' } | ||
|
||
static path() { return 'web.js' } | ||
|
||
@ $mol_action | ||
static send(data: {}) {} | ||
|
||
static init() {} | ||
|
||
static blocked_response() { | ||
return new Response( | ||
null, | ||
{ | ||
status: 418, | ||
statusText: 'Blocked' | ||
}, | ||
) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,13 @@ | ||
namespace $ { | ||
|
||
export class $mol_service extends $mol_object { | ||
static in_worker() { return typeof window === 'undefined' } | ||
|
||
static path() { return 'web.js' } | ||
|
||
@ $mol_action | ||
static send(data: {}) {} | ||
|
||
protected static plugins = new Set<typeof $mol_service_plugin>() | ||
|
||
static attach(plugin: typeof $mol_service_plugin) { | ||
this.plugins.add(plugin) | ||
} | ||
|
||
static detach(plugin: typeof $mol_service_plugin) { | ||
this.plugins.delete(plugin) | ||
} | ||
|
||
namespace $.$mol_service { | ||
export class $mol_service_plugin extends $mol_object { | ||
static init() {} | ||
|
||
static blocked_response() { | ||
return new Response( | ||
null, | ||
{ | ||
status: 418, | ||
statusText: 'Blocked' | ||
}, | ||
) | ||
} | ||
static before_install() {} | ||
static install() { return null as undefined | null | Promise<unknown> } | ||
static activate() { return null as undefined | null | Promise<unknown> } | ||
static state_change() {} | ||
static message_data(data: {}) { return null as null | undefined | Promise<unknown> } | ||
|
||
static blocked(res: Request) { return false } | ||
static modify(res: Request) { return null as null | Response | PromiseLike<Response> } | ||
} | ||
|
||
} |