Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

separating workers #69

Closed
wants to merge 3 commits into from
Closed

separating workers #69

wants to merge 3 commits into from

Conversation

nojaf
Copy link
Member

@nojaf nojaf commented Sep 23, 2018

See #67.
Not sure if I made things better.
The test.fsx represents code I have in my current service worker.
It is an improvement because of the latest ts2fable generation of lib.webworker.d.ts.

However I believe some manually work to Fable.Import.WebWorkers will still be required.

let myInfo = payload :?> MyPushNotificationInfo

let title = "My title"
let options:NotificationOptions =
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How should this be tackled? What should NotificationOptions be in this case? Just a plain record?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When facing this kind of situation I like to provide an helper on top of it.

Something like:

Notification.empty
|> Notification.body "my body"
|> Notification.icon "my-icon"
....

Like that the user only specify what is needed for him. This is the same approach I used in Thoth.Elmish.Toast for example.

@nojaf nojaf changed the title [WIP] separating workers separating workers Oct 4, 2018
@nojaf
Copy link
Member Author

nojaf commented Oct 20, 2018

Might re-do this in the future sometime, no intentions to finish this in its current form.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants